closestPoint Method

Compute the projection of a barycentric point p to the triangle T(v_0,v_1,v_2).

closestPoint(b0: number, b1: number, b2: number): { closestEdgeIndex: number, closestEdgeParam: number }

Parameter Type Description
b0 number barycentric coordinate of p corresponding to v_0
b1 number barycentric coordinate of p corresponding to v_1
b2 number barycentric coordinate of p corresponding to v_2

Returns - { closestEdgeIndex: number, closestEdgeParam: number }

closest edge start vertex index i and projection parameter u such that the projection q = v_i + u * (v_j - v_i).

Defined in

Last Updated: 20 June, 2023