Premium problem78. Distance Point to Lines

Hard Locked

Given sets of points P0, P1 (shape (n, 2)) describing lines, and a single point p (shape (1, 2)), return the distance from p to each line i.

Input

P0 =
[[0. 0.]
 [0. 0.]]
P1 =
[[1. 0.]
 [0. 1.]]
p = [[1. 1.]]

Output

[1. 1.]

Premium problem

This one's part of Premium. Unlock the full NumPy track plus every other premium problem on the site.

Implement solve(...)