Math.Geometry


Line Segment 2D

Builders

LineSegment2D.from (Point2D.meters 3. 4.) (Point2D.meters -8. 2.)
LineSegment2D.fromEndpoints (Point2D.meters 3. 4., Point2D.meters -8. 2.)
LineSegment2D.safeFrom (Point2D.meters 3. 4.) (Point2D.meters -8. 2.)
No value returned by any evaluator
LineSegment2D.safeFrom (Point2D.meters 2. 1.) (Point2D.meters 2. 1.)
No value returned by any evaluator
LineSegment2D.fromPointAndVector Point2D.origin (Vector2D.meters 7. 8.)
LineSegment2D.along Axis2D.x (Length.meters 3.) (Length.meters 7.)

Accessors

let segment: LineSegment2D<Meters, Cartesian> =
    LineSegment2D.from (Point2D.meters 3. 4.) (Point2D.meters -8. 2.)
LineSegment2D.start segment // or
segment.Start
No value returned by any evaluator
LineSegment2D.finish segment // or
segment.Finish
No value returned by any evaluator
LineSegment2D.endpoints segment
No value returned by any evaluator
LineSegment2D.vector segment
No value returned by any evaluator
LineSegment2D.direction segment
No value returned by any evaluator
LineSegment2D.length segment
No value returned by any evaluator
LineSegment2D.axis segment
No value returned by any evaluator
LineSegment2D.perpendicularDirection segment
No value returned by any evaluator
LineSegment2D.midpoint segment
No value returned by any evaluator

Modifiers

LineSegment2D.mapEndpoints (Point2D.plus (Vector2D.meters 4. 2.))
LineSegment2D.reverse segment
No value returned by any evaluator
LineSegment2D.scaleAbout
LineSegment2D.rotateAround
LineSegment2D.translateBy
LineSegment2D.translateIn
LineSegment2D.mirrorAcross
LineSegment2D.projectOnto
LineSegment2D.round

Queries

LineSegment2D.interpolate
LineSegment2D.areParallel
LineSegment2D.isPointOnSegment
LineSegment2D.distanceToPoint
LineSegment2D.pointClosestTo
LineSegment2D.intersectionPoint
LineSegment2D.intersectionWithAxis
LineSegment2D.signedDistanceAlong
LineSegment2D.signedDistanceFrom
LineSegment2D.relativeTo
LineSegment2D.placeIn
LineSegment2D.boundingBox
namespace Math
namespace Math.Geometry
namespace Math.Units
Multiple items
union case Cartesian.Cartesian: Cartesian

--------------------
type Cartesian = | Cartesian
Multiple items
module LineSegment2D from Math.Geometry

--------------------
[<Struct>] type LineSegment2D<'Units,'Coordinates> = { Start: Point2D<'Units,'Coordinates> Finish: Point2D<'Units,'Coordinates> } interface IComparable interface IComparable<LineSegment2D<'Units,'Coordinates>> interface IGeometry<'Coordinates> member Comparison : other:LineSegment2D<'Units,'Coordinates> -> int override Equals : obj:obj -> bool override GetHashCode : unit -> int member LessThan : other:LineSegment2D<'Units,'Coordinates> -> bool static member ( * ) : lhs:LineSegment2D<'Units,'Coordinates> * rhs:float -> LineSegment2D<'Units,'Coordinates> + 1 overload static member ( / ) : lhs:LineSegment2D<'Units,'Coordinates> * rhs:float -> LineSegment2D<'Units,'Coordinates> + 1 overload
val from : start:Point2D<'Units,'Coordinates> -> finish:Point2D<'Units,'Coordinates> -> LineSegment2D<'Units,'Coordinates>
<summary> 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 &lt;see cref="safeFrom"/&gt; function. </summary>
Multiple items
module Point2D from Math.Geometry

--------------------
[<Struct>] type Point2D<'Units,'Coordinates> = { X: Quantity<'Units> Y: Quantity<'Units> } interface IComparable interface IComparable<Point2D<'Units,'Coordinates>> interface IGeometry<'Coordinates> member Comparison : other:Point2D<'Units,'Coordinates> -> int override Equals : obj:obj -> bool + 1 overload override GetHashCode : unit -> int member LessThan : other:Point2D<'Units,'Coordinates> -> bool static member ( * ) : lhs:Point2D<'Units,'Coordinates> * rhs:float -> Point2D<'Units,'Coordinates> + 1 overload static member ( + ) : lhs:Point2D<'Units,'Coordinates> * rhs:Vector2D<'Units,'Coordinates> -> Point2D<'Units,'Coordinates> static member ( - ) : lhs:Point2D<'Units,'Coordinates> * rhs:Point2D<'Units,'Coordinates> -> Vector2D<'Units,'Coordinates> + 1 overload ...
val meters : x:float -> y:float -> Point2D<Meters,'Coordinates>
val fromEndpoints : Point2D<'Units,'Coordinates> * Point2D<'Units,'Coordinates> -> LineSegment2D<'Units,'Coordinates>
<summary> Construct a segment segment from it's two endpoints as a tuple. </summary>
val safeFrom : start:Point2D<'Units,'Coordinates> -> finish:Point2D<'Units,'Coordinates> -> LineSegment2D<'Units,'Coordinates> option
<summary> Safely create a segment segment. This function returns `None` when the two points are almost equal. This has to do with the &lt;see cref="Geometry.Internal.Tolerance"/&gt;. </summary>
Multiple items
union case Meters.Meters: Meters

--------------------
type Meters = | Meters
<category>Unit</category>
val fromPointAndVector : start:Point2D<'Units,'Coordinates> -> direction:Vector2D<'Units,'Coordinates> -> Line2D<'Units,'Coordinates>
<summary> Create a segment segment starting at point in a particular direction and length </summary>
val origin<'Units,'Coordinates> : Point2D<'Units,'Coordinates>
Multiple items
module Vector2D from Math.Geometry

--------------------
[<Struct>] type Vector2D<'Units,'Coordinates> = { X: Quantity<'Units> Y: Quantity<'Units> } interface IComparable interface IComparable<Vector2D<'Units,'Coordinates>> interface IGeometry<'Coordinates> member Comparison : other:Vector2D<'Units,'Coordinates> -> int override Equals : obj:obj -> bool + 1 overload override GetHashCode : unit -> int member LessThan : other:Vector2D<'Units,'Coordinates> -> bool static member ( * ) : vector:Vector2D<'Units,'Coordinates> * scale:float -> Vector2D<'Units,'Coordinates> + 1 overload static member ( + ) : lhs:Vector2D<'Units,'Coordinates> * rhs:Vector2D<'Units,'Coordinates> -> Vector2D<'Units,'Coordinates> static member ( - ) : lhs:Vector2D<'Units,'Coordinates> * rhs:Vector2D<'Units,'Coordinates> -> Vector2D<'Units,'Coordinates> ...
val meters : x:float -> y:float -> Vector2D<Meters,'Coordinates>
val along : axis:Axis2D<'Units,'Coordinates> -> start:Quantity<'Units> -> finish:Quantity<'Units> -> LineSegment2D<'Units,'Coordinates>
<summary> Construct a segment segment lying on the given axis, with its endpoints at the given distances from the axis' origin point. </summary>
Multiple items
module Axis2D from Math.Geometry

--------------------
[<Struct>] type Axis2D<'Units,'Coordinates> = { Origin: Point2D<'Units,'Coordinates> Direction: Direction2D<'Coordinates> } interface IGeometry<'Coordinates> override Equals : obj:obj -> bool override GetHashCode : unit -> int
val x<'Units,'Coordinates> : Axis2D<'Units,'Coordinates>
Multiple items
module Length from Math.Units
<category>Module: Unit System</category>
<summary> A <c>Length</c> represents a length in meters, feet, centimeters, miles etc. It is stored as a number of meters. </summary>


--------------------
type Length = Quantity<Meters>
<category>Unit System</category>
val meters : m:float -> Length
<category index="2">Metric</category>
val segment : LineSegment2D<Meters,Cartesian>
val start : segment:LineSegment2D<'Units,'Coordinates> -> Point2D<'Units,'Coordinates>
LineSegment2D.Start: Point2D<Meters,Cartesian>
val finish : segment:LineSegment2D<'Units,'Coordinates> -> Point2D<'Units,'Coordinates>
LineSegment2D.Finish: Point2D<Meters,Cartesian>
val endpoints : segment:LineSegment2D<'Units,'Coordinates> -> Point2D<'Units,'Coordinates> * Point2D<'Units,'Coordinates>
val vector : segment:LineSegment2D<'Units,'Coordinates> -> Vector2D<'Units,'Coordinates>
<summary> Get the vector from the start point to the end point of the segment segment </summary>
val direction : segment:LineSegment2D<'Units,'Coordinates> -> Direction2D<'Coordinates> option
val length : segment:LineSegment2D<'Units,'Coordinates> -> Quantity<'Units>
val axis : segment:LineSegment2D<'Units,'Coordinates> -> Axis2D<'Units,'Coordinates> option
val perpendicularDirection : segment:LineSegment2D<'Units,'Coordinates> -> Direction2D<'Coordinates> option
<summary> Get the direction perpendicular to a segment segment, pointing to the left. If the segment segment has zero length, returns `Nothing`. </summary>
val midpoint : segment:LineSegment2D<'Units,'Coordinates> -> Point2D<'Units,'Coordinates>
val mapEndpoints : f:(Point2D<'UnitA,'CoordinatesA> -> Point2D<'UnitB,'CoordinatesB>) -> segment:LineSegment2D<'UnitA,'CoordinatesA> -> LineSegment2D<'UnitB,'CoordinatesB>
<summary> 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` </summary>
val plus : rhs:Vector2D<'Units,'Coordinates> -> lhs:Point2D<'Units,'Coordinates> -> Point2D<'Units,'Coordinates>
<summary> This function is designed to be used in piping operators. </summary>
val reverse : segment:LineSegment2D<'Units,'Coordinates> -> LineSegment2D<'Units,'Coordinates>
val scaleAbout : point:Point2D<'Units,'Coordinates> -> scale:float -> segment:LineSegment2D<'Units,'Coordinates> -> LineSegment2D<'Units,'Coordinates>
<summary> Scale a line segment about the given center point by the given scale. </summary>
val rotateAround : centerPoint:Point2D<'Units,'Coordinates> -> angle:Angle -> segment:LineSegment2D<'Units,'Coordinates> -> LineSegment2D<'Units,'Coordinates>
<summary> Rotate a line segment counterclockwise around a given center point by a given angle. </summary>
val translateBy : displacementVector:Vector2D<'Units,'Coordinates> -> segment:LineSegment2D<'Units,'Coordinates> -> LineSegment2D<'Units,'Coordinates>
<summary> Translate a line segment by a given displacement. </summary>
val translateIn : translationDirection:Direction2D<'Coordinates> -> distance:Quantity<'Units> -> lineSegment:LineSegment2D<'Units,'Coordinates> -> LineSegment2D<'Units,'Coordinates>
<summary> Translate a line segment in a given direction by a given distance. </summary>
val mirrorAcross : axis:Axis2D<'Units,'Coordinates> -> segment:LineSegment2D<'Units,'Coordinates> -> LineSegment2D<'Units,'Coordinates>
<summary> 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). </summary>
val projectOnto : axis:Axis2D<'Units,'Coordinates> -> segment:LineSegment2D<'Units,'Coordinates> -> LineSegment2D<'Units,'Coordinates>
<summary> Project a line segment onto an axis. </summary>
val round : segment:LineSegment2D<'Units,'Coordinates> -> LineSegment2D<'Units,'d>
val interpolate : segment:LineSegment2D<'Units,'Coordinates> -> t:float -> Point2D<'Units,'Coordinates>
val areParallel : first:LineSegment2D<'Units,'Coordinates> -> second:LineSegment2D<'Units,'Coordinates> -> bool
val isPointOnSegment : point:Point2D<'Units,'Coordinates> -> segment:LineSegment2D<'Units,'Coordinates> -> bool
val distanceToPoint : point:Point2D<'Units,'Coordinates> -> segment:LineSegment2D<'Units,'Coordinates> -> Quantity<'Units>
val pointClosestTo : point:Point2D<'Units,'Coordinates> -> segment:LineSegment2D<'Units,'Coordinates> -> Point2D<'Units,'Coordinates>
<summary> Get the point on a line segment that is closest to the input point. </summary>
val intersectionPoint : lineSegment1:LineSegment2D<'Units,'Coordinates> -> lineSegment2:LineSegment2D<'Units,'Coordinates> -> Point2D<'Units,'Coordinates> option
<summary> Try to find the intersection between two lines. If the lines are parallel (even if they are overlapping) then no intersection is returned </summary>
val intersectionWithAxis : axis:Axis2D<'Units,'Coordinates> -> lineSegment:LineSegment2D<'Units,'Coordinates> -> Point2D<'Units,'Coordinates> option
<summary> 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`. </summary>
val signedDistanceAlong : axis:Axis2D<'Units,'Coordinates> -> segment:LineSegment2D<'Units,'Coordinates> -> Interval<'Units>
<summary> 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. </summary>
val signedDistanceFrom : axis:Axis2D<'Units,'Coordinates> -> segment:LineSegment2D<'Units,'Coordinates> -> Interval<'Units>
<summary> 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. </summary>
val relativeTo : frame:Frame2D<'Units,'GlobalCoordinates,'LocalCoordinates> -> segment:LineSegment2D<'Units,'GlobalCoordinates> -> LineSegment2D<'Units,'LocalCoordinates>
<summary> Take a line segment defined in global coordinates, and return it expressed in local coordinates relative to a given reference frame. </summary>
val placeIn : frame:Frame2D<'Units,'GlobalCoordinates,'LocalCoordinates> -> segment:LineSegment2D<'Units,'LocalCoordinates> -> LineSegment2D<'Units,'GlobalCoordinates>
<summary> 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. </summary>
val boundingBox : segment:LineSegment2D<'Units,'Coordinates> -> BoundingBox2D<'Units,'Coordinates>
<summary> Get the minimal bounding box containing a given line segment. </summary>