Find closest orthogonal projection of point onto points array
source point
target points
Edge object containing info about the projected point, or null if points is a degenerate path (0- or 1- point).
null
points
c | a --*--- b * = [2, 0]const a = [0, 0];const b = [5, 0];const c = [2, 1];vecProject(c, [a, b]); // returns Edge { index: 1, distance: 1, point: [2, 0] } Copy
c | a --*--- b * = [2, 0]const a = [0, 0];const b = [5, 0];const c = [2, 1];vecProject(c, [a, b]); // returns Edge { index: 1, distance: 1, point: [2, 0] }
Find closest orthogonal projection of point onto points array