Method DistancePointLineSegment
DistancePointLineSegment(Vector2, Vector2, Vector2)
Returns the distance between a point and a finite line segment using Vector2s.
Declaration
public static float DistancePointLineSegment(Vector2 point, Vector2 lineStart, Vector2 lineEnd)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | point | The point. |
Vector2 | lineStart | Where the line starts. |
Vector2 | lineEnd | Where the line ends. |
Returns
Type | Description |
---|---|
float | The distance from the point to the nearest point on a line segment. |
Remarks
DistancePointLineSegment(Vector3, Vector3, Vector3)
Returns the distance between a point and a finite line segment using Vector3s.
Declaration
public static float DistancePointLineSegment(Vector3 point, Vector3 lineStart, Vector3 lineEnd)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | point | The point. |
Vector3 | lineStart | Line start. |
Vector3 | lineEnd | Line end. |
Returns
Type | Description |
---|---|
float | The distance from point to the nearest point on a line segment. |