This repository has been archived by the owner on Oct 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 422
f3695855 d038 3e36 3e99 db06f5398937
haplokuon edited this page May 6, 2023
·
1 revision
netDxf 3.0.0 Library
Checks if a point is inside a line segment.
Namespace: netDxf
Assembly: netDxf (in netDxf.dll) Version: 3.0.0
C#
public static int PointInSegment(
Vector3 p,
Vector3 start,
Vector3 end
)
VB
Public Shared Function PointInSegment (
p As Vector3,
start As Vector3,
end As Vector3
) As Integer
C++
public:
static int PointInSegment(
Vector3 p,
Vector3 start,
Vector3 end
)
F#
static member PointInSegment :
p : Vector3 *
start : Vector3 *
end : Vector3 -> int
Int32
Zero if the point is inside the segment, 1 if the point is after the end point, and -1 if the point is before the start point.
For testing purposes a point is considered inside a segment, if it falls inside the volume from start to end of the segment that extends infinitely perpendicularly to its direction. Later, if needed, you can use the PointLineDistance method, if the distance is zero the point is along the line defined by the start and end points.