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.
P0
P1
(n, 2)
p
(1, 2)
i
Input
P0 = [[0. 0.] [0. 0.]] P1 = [[1. 0.] [0. 1.]] p = [[1. 1.]]
Output
[1. 1.]
This one's part of Premium. Unlock the full NumPy track plus every other premium problem on the site.
solve(...)