Method TryGetBarycentric
- Namespace
- GeometryHelper.Geometry
- Assembly
- GeometryHelper.dll
TryGetBarycentric(GeoPoint3, out double, out double, out double)
Gets the barycentric coordinates of a point with respect to this triangle.
public bool TryGetBarycentric(GeoPoint3 point, out double u, out double v, out double w)
Parameters
pointGeoPoint3The point to express; it need not lie on the triangle.
udoubleWeight of vertex A.
vdoubleWeight of vertex B.
wdoubleWeight of vertex C.
Returns
- bool
false when the triangle is degenerate, in which case all three weights are zero.
Remarks
The point is projected onto the triangle plane first, so a point off the plane gets the coordinates of its projection. The three weights always sum to one, and all three are non-negative exactly when the projection falls inside the triangle.