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 }

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

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 f such that the projection q = v_i + f * (v_j - v_i).

Defined in

Last Updated: 28 October, 2024