Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

f3695855 d038 3e36 3e99 db06f5398937

haplokuon edited this page May 6, 2023 · 1 revision

PointInSegment(Vector3, Vector3, Vector3) Method

netDxf 3.0.0 Library

Checks if a point is inside a line segment.

Definition

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 

Parameters

  Vector3
A point.
  Vector3
Segment start point.
  Vector3
Segment end point.

Return Value

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.

Remarks

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.

See Also

Reference

MathHelper Class
PointInSegment Overload
netDxf Namespace

Clone this wiki locally