Function or value | Description |
|
![]() ![]() ![]() ![]() ![]() ![]() Construct a segment segment lying on the given axis, with its endpoints at the given distances from the axis' origin point.
|
Full Usage:
areParallel first second
Parameters:
LineSegment2D<'Units, 'Coordinates>
second : LineSegment2D<'Units, 'Coordinates>
Returns: bool
|
|
Full Usage:
axis segment
Parameters:
LineSegment2D<'Units, 'Coordinates>
Returns: Axis2D<'Units, 'Coordinates> option
|
|
Full Usage:
boundingBox segment
Parameters:
LineSegment2D<'Units, 'Coordinates>
Returns: BoundingBox2D<'Units, 'Coordinates>
|
|
Full Usage:
direction segment
Parameters:
LineSegment2D<'Units, 'Coordinates>
Returns: Direction2D<'Coordinates> option
|
|
Full Usage:
distanceToPoint point segment
Parameters:
Point2D<'Units, 'Coordinates>
segment : LineSegment2D<'Units, 'Coordinates>
Returns: Quantity<'Units>
|
|
Full Usage:
endpoints segment
Parameters:
LineSegment2D<'Units, 'Coordinates>
Returns: Point2D<'Units, 'Coordinates> * Point2D<'Units, 'Coordinates>
|
|
Full Usage:
finish segment
Parameters:
LineSegment2D<'Units, 'Coordinates>
Returns: Point2D<'Units, 'Coordinates>
|
|
|
![]() ![]() ![]() ![]() ![]() ![]()
Generate a segment segment from two points. This doesn't perform any checks ensuring that the points are not equal.
If that is the behavior that you want you should use
|
|
|
|
|
Full Usage:
interpolate segment t
Parameters:
LineSegment2D<'Units, 'Coordinates>
t : float
Returns: Point2D<'Units, 'Coordinates>
|
|
Full Usage:
intersectionPoint lineSegment1 lineSegment2
Parameters:
LineSegment2D<'Units, 'Coordinates>
lineSegment2 : LineSegment2D<'Units, 'Coordinates>
Returns: Point2D<'Units, 'Coordinates> option
|
![]() ![]() ![]() ![]() ![]() ![]() Try to find the intersection between two lines. If the lines are parallel (even if they are overlapping) then no intersection is returned
|
Full Usage:
intersectionWithAxis axis lineSegment
Parameters:
Axis2D<'Units, 'Coordinates>
lineSegment : LineSegment2D<'Units, 'Coordinates>
Returns: Point2D<'Units, 'Coordinates> option
|
![]() ![]() ![]() ![]() ![]() ![]() Attempt to find the unique intersection point of a line segment with an axis. If there is no such point (the line segment does not touch the axis, or lies perfectly along it), returns `Nothing`.
|
Full Usage:
isPointOnSegment point segment
Parameters:
Point2D<'Units, 'Coordinates>
segment : LineSegment2D<'Units, 'Coordinates>
Returns: bool
|
|
Full Usage:
length segment
Parameters:
LineSegment2D<'Units, 'Coordinates>
Returns: Quantity<'Units>
|
|
Full Usage:
mapEndpoints f segment
Parameters:
Point2D<'UnitA, 'CoordinatesA> -> Point2D<'UnitB, 'CoordinatesB>
segment : LineSegment2D<'UnitA, 'CoordinatesA>
Returns: LineSegment2D<'UnitB, 'CoordinatesB>
|
![]() ![]() ![]() ![]() ![]() ![]() Transform the start and end points of a line segment by a given function and create a new line segment from the resulting points. Most other transformation functions can be defined in terms of `mapEndpoints`
|
Full Usage:
midpoint segment
Parameters:
LineSegment2D<'Units, 'Coordinates>
Returns: Point2D<'Units, 'Coordinates>
|
|
Full Usage:
mirrorAcross axis segment
Parameters:
Axis2D<'Units, 'Coordinates>
segment : LineSegment2D<'Units, 'Coordinates>
Returns: LineSegment2D<'Units, 'Coordinates>
|
![]() ![]() ![]() ![]() ![]() ![]() Mirror a line segment across an axis. Note that the endpoints of a mirrored segment are equal to the mirrored endpoints of the original segment, but as a result the normal direction of a mirrored segment is the _opposite_ of the mirrored normal direction of the original segment (since the normal direction is always considered to be 'to the left' of the line segment).
|
Full Usage:
perpendicularDirection segment
Parameters:
LineSegment2D<'Units, 'Coordinates>
Returns: Direction2D<'Coordinates> option
|
![]() ![]() ![]() ![]() ![]() ![]() Get the direction perpendicular to a segment segment, pointing to the left. If the segment segment has zero length, returns `Nothing`.
|
Full Usage:
placeIn frame segment
Parameters:
Frame2D<'Units, 'GlobalCoordinates, 'LocalCoordinates>
segment : LineSegment2D<'Units, 'LocalCoordinates>
Returns: LineSegment2D<'Units, 'GlobalCoordinates>
|
![]() ![]() ![]() ![]() ![]() ![]() Take a line segment considered to be defined in local coordinates relative to a given reference frame, and return that line segment expressed in global coordinates.
|
Full Usage:
pointClosestTo point segment
Parameters:
Point2D<'Units, 'Coordinates>
segment : LineSegment2D<'Units, 'Coordinates>
Returns: Point2D<'Units, 'Coordinates>
|
|
Full Usage:
projectOnto axis segment
Parameters:
Axis2D<'Units, 'Coordinates>
segment : LineSegment2D<'Units, 'Coordinates>
Returns: LineSegment2D<'Units, 'Coordinates>
|
|
Full Usage:
relativeTo frame segment
Parameters:
Frame2D<'Units, 'GlobalCoordinates, 'LocalCoordinates>
segment : LineSegment2D<'Units, 'GlobalCoordinates>
Returns: LineSegment2D<'Units, 'LocalCoordinates>
|
![]() ![]() ![]() ![]() ![]() ![]() Take a line segment defined in global coordinates, and return it expressed in local coordinates relative to a given reference frame.
|
Full Usage:
reverse segment
Parameters:
LineSegment2D<'Units, 'Coordinates>
Returns: LineSegment2D<'Units, 'Coordinates>
|
|
Full Usage:
rotateAround centerPoint angle segment
Parameters:
Point2D<'Units, 'Coordinates>
angle : Angle
segment : LineSegment2D<'Units, 'Coordinates>
Returns: LineSegment2D<'Units, 'Coordinates>
|
|
Full Usage:
round segment
Parameters:
LineSegment2D<'Units, 'Coordinates>
Returns: LineSegment2D<'Units, 'a>
|
|
|
![]() ![]() ![]() ![]() ![]() ![]()
Safely create a segment segment. This function returns `None` when the two points are almost equal.
This has to do with the
|
Full Usage:
scaleAbout point scale segment
Parameters:
Point2D<'Units, 'Coordinates>
scale : float
segment : LineSegment2D<'Units, 'Coordinates>
Returns: LineSegment2D<'Units, 'Coordinates>
|
|
Full Usage:
signedDistanceAlong axis segment
Parameters:
Axis2D<'Units, 'Coordinates>
segment : LineSegment2D<'Units, 'Coordinates>
Returns: Interval<'Units>
|
![]() ![]() ![]() ![]() ![]() ![]() Measure the distance of a line segment along an axis. This is the range of distances along the axis resulting from projecting the line segment perpendicularly onto the axis. Note that reversing the line segment will _not_ affect the result.
|
Full Usage:
signedDistanceFrom axis segment
Parameters:
Axis2D<'Units, 'Coordinates>
segment : LineSegment2D<'Units, 'Coordinates>
Returns: Interval<'Units>
|
![]() ![]() ![]() ![]() ![]() ![]() Measure the distance of a line segment from an axis. If the returned interval: - is entirely positive, then the line segment is to the left of the axis - is entirely negative, then the line segment is to the right of the axis - contains zero, then the line segment crosses the axis Note that reversing the line segment will _not_ affect the result.
|
Full Usage:
start segment
Parameters:
LineSegment2D<'Units, 'Coordinates>
Returns: Point2D<'Units, 'Coordinates>
|
|
Full Usage:
translateBy displacementVector segment
Parameters:
Vector2D<'Units, 'Coordinates>
segment : LineSegment2D<'Units, 'Coordinates>
Returns: LineSegment2D<'Units, 'Coordinates>
|
|
Full Usage:
translateIn translationDirection distance lineSegment
Parameters:
Direction2D<'Coordinates>
distance : Quantity<'Units>
lineSegment : LineSegment2D<'Units, 'Coordinates>
Returns: LineSegment2D<'Units, 'Coordinates>
|
|
Full Usage:
vector segment
Parameters:
LineSegment2D<'Units, 'Coordinates>
Returns: Vector2D<'Units, 'Coordinates>
|
|