Click or drag to resize
LineSegment2I Structure
The class encapsulates a 2D line segment and provides some tool methods related to line segments.

Namespace: Slash.Math.Geometry.Lines
Assembly: Slash.Math (in Slash.Math.dll) Version: 1.0.6018.40177
Syntax
public struct LineSegment2I

The LineSegment2I type exposes the following members.

Constructors
  NameDescription
Public methodLineSegment2I
Initializes a new instance of the LineSegment2I class.
Top
Properties
  NameDescription
Public propertyCenter
Center point on the line segment.
Public propertyDirection
Returns the direction of the line segment, assuming that PointA is the start point.
Public propertyLength
Length of the line segment.
Top
Methods
  NameDescription
Public methodComputeSide
Computes on which side of the line segment the passed point lies
Public methodGetClosestPoint
Computes the closest point on the line to the passed point
Public methodGetSquareDistance
Returns the squared distance of this segment to the passed point
Public methodStatic memberIntersect(LineSegment2I, LineSegment2I)
Checks if the passed line segments intersect
Public methodStatic memberIntersect(LineSegment2I, LineSegment2I, Vector2F)
Checks if the passed line segments intersect and computes the intersection point if they do
Public methodStatic memberIntersect(Vector2I, Vector2I, Vector2I, Vector2I, Vector2F)
This method detects if two line segments intersect, and, if so, the point of intersection. Note: If two line segments are coincident, then no intersection is detected (there are actually infinite intersection points).
Public methodStatic memberIntersect(Vector2I, Vector2I, Vector2I, Vector2I, Vector2F)
This method detects if two line segments intersect, and, if so, the point of intersection. Note: If two line segments are coincident, then no intersection is detected (there are actually infinite intersection points).
Public methodStatic memberIntersect(Vector2I, Vector2I, Vector2I, Vector2I, Boolean, Boolean, Vector2F)
This method detects if two line segments (or lines) intersect, and, if so, the point of intersection. Use the firstIsSegment and secondIsSegment parameters to set whether the intersection point must be on the first and second line segments. Setting these both to true means you are doing a line-segment to line-segment intersection. Setting one of them to true means you are doing a line to line-segment intersection test, and so on. Note: If two line segments are coincident, then no intersection is detected (there are actually infinite intersection points). Author: Jeremy Bell
Public methodStatic memberIntersect(Vector2I, Vector2I, Vector2I, Vector2I, Boolean, Boolean, Vector2F)
This method detects if two line segments (or lines) intersect, and, if so, the point of intersection. Use the firstIsSegment and secondIsSegment parameters to set whether the intersection point must be on the first and second line segments. Setting these both to true means you are doing a line-segment to line-segment intersection. Setting one of them to true means you are doing a line to line-segment intersection test, and so on. Note: If two line segments are coincident, then no intersection is detected (there are actually infinite intersection points). Author: Jeremy Bell
Top
Fields
  NameDescription
Public fieldPointA
First point of the line segment
Public fieldPointB
Second point of the line segment
Top
See Also