Table of Contents

Method TryGetBarycentric

Namespace
GeometryHelper.Geometry
Assembly
GeometryHelper.dll

TryGetBarycentric(GeoPoint2, out double, out double, out double)

Gets the barycentric coordinates of a point with respect to this triangle.

public bool TryGetBarycentric(GeoPoint2 point, out double u, out double v, out double w)

Parameters

point GeoPoint2

The point to express; it need not lie within the triangle.

u double

Weight of vertex A.

v double

Weight of vertex B.

w double

Weight of vertex C.

Returns

bool

false when the triangle is degenerate, in which case all three weights are nought.

Remarks

The three weights always add up to one, and all three are positive or nought exactly when the point lies within the triangle.