Click or drag to resize

UtilPointBetween Method (Vector3, Vector3, Vector3, Double)

P is expected to be on the projection of [U1,U2] but this function will return whether it is between U1 and U2 (using the supplied epsilon as the tolerance for comparisons).

Namespace:  Demo3D.Common
Assembly:  Demo3D.Common (in Demo3D.Common.dll) Version: 15.0.2.11458
Syntax
C#
public static bool PointBetween(
	Vector3 P,
	Vector3 U1,
	Vector3 U2,
	double epsilon
)

Parameters

P
Type: Microsoft.DirectXVector3
Point to test.
U1
Type: Microsoft.DirectXVector3
Start of line segment.
U2
Type: Microsoft.DirectXVector3
End of line segment.
epsilon
Type: SystemDouble
Tolerance to use in the comparisons.

Return Value

Type: Boolean
True if the point P (projected onto the line segment) is between the start and end of the segment, false otherwise.
Remarks
If U1 is equal to U2, then this will always return true.
See Also