Math.Geometry


Builders

Frame2D.atOrigin
Frame2D.atPoint (Point2D.meters 4. 2.)
Frame2D.withXDirection (Direction2D.fromAngle (Angle.degrees 30.)) (Point2D.meters 3. 1.)
Frame2D.withYDirection (Direction2D.fromAngle (Angle.degrees -60.)) (Point2D.meters -1. 2.)
Frame2D.withAngle (Angle.degrees 20.) (Point2D.meters 2. 3.)
let axis: Axis2D<Meters, Cartesian> =
    Axis2D.through (Point2D.meters 3. 2.) (Direction2D.fromAngle Angle.pi)
Frame2D.fromXAxis axis
Frame2D.fromYAxis axis

Accessors

let frame: Frame2D<Meters, Cartesian, unit> =
    Frame2D.withAngle (Angle.degrees 20.) (Point2D.meters 2. 3.)
Frame2D.originPoint frame // or

frame.Origin
No value returned by any evaluator
Frame2D.xDirection frame // or

frame.XDirection
No value returned by any evaluator
Frame2D.yDirection frame // or

frame.YDirection
No value returned by any evaluator
Frame2D.isRightHanded frame
No value returned by any evaluator
Frame2D.yAxis frame
No value returned by any evaluator
Frame2D.xAxis frame
No value returned by any evaluator

Modifiers

Frame2D.reverseX frame
Frame2D.reverseY frame
Frame2D.moveTo Point2D.origin frame
Frame2D.rotateBy (Angle.degrees 30.) frame
Frame2D.rotateAround (Point2D.meters -3. -2.) (Angle.degrees 70.) frame
Frame2D.translateBy (Vector2D.meters 4. 7.) frame
Frame2D.translateIn
Frame2D.translateAlongOwn
Frame2D.mirrorAcross
Frame2D.relativeTo
Frame2D.placeIn
namespace Math
namespace Math.Geometry
namespace Math.Units
Multiple items
union case Cartesian.Cartesian: Cartesian

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

--------------------
type Frame2D<'Units,'Coordinates,'Defines> = { Origin: Point2D<'Units,'Coordinates> XDirection: Direction2D<'Coordinates> YDirection: Direction2D<'Coordinates> } interface IGeometry<'Coordinates>
val atOrigin<'Units,'Coordinates,'Defines> : Frame2D<'Units,'Coordinates,'Defines>
val atPoint : point:Point2D<'Units,'Coordinates> -> Frame2D<'Units,'Coordinates,'Defines>
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 withXDirection : xDirection:Direction2D<'a> -> origin:Point2D<'b,'a> -> Frame2D<'b,'a,'c>
<summary> Construct a frame with the given Y axis direction, having the given origin point. The X axis direction will be constructed by rotating the given direction 90 degrees clockwise. </summary>
Multiple items
module Direction2D from Math.Geometry

--------------------
type Direction2D<'Coordinates> = { X: float Y: float } interface IComparable interface IComparable<Direction2D<'Coordinates>> interface IGeometry<'Coordinates> member Comparison : other:Direction2D<'Coordinates> -> int override Equals : obj:obj -> bool + 1 overload override GetHashCode : unit -> int member LessThan : other:Direction2D<'Coordinates> -> bool static member xy : x:float -> y:float -> Direction2D<'Coordinates> option
val fromAngle : angle:Angle -> Direction2D<'Coordinates>
Multiple items
module Angle from Math.Units
<category>Module: Unit System</category>
<summary> An <c>Angle</c> represents an angle in degrees, radians, or turns. It is stored as a number of radians. </summary>
<note> Angles are sometimes measured in degrees, minutes, and seconds, where 1 minute = 1/60th of a degree and 1 second = 1/60th of a minute. </note>
<example> You can construct an angle from your unit scheme. All of the following are equivalent. <code> Angle.radians Math.PI Angle.degrees 180. Angle.turns 0.5 </code></example>


--------------------
type Angle = Quantity<Radians>
<category>Unit System</category>
val degrees : d:float -> Angle
<category>Degrees</category>
Create an angle from a number of degrees.
val withYDirection : givenDirection:Direction2D<'Coordinates> -> givenOrigin:Point2D<'Units,'Coordinates> -> Frame2D<'Units,'Coordinates,'Defines>
<summary> Construct a frame with the given Y axis direction, having the given origin point. The X axis direction will be constructed by rotating the given Y direction 90 degrees clockwise. </summary>
val withAngle : angle:Angle -> origin:Point2D<'Units,'Coordinates> -> Frame2D<'Units,'Coordinates,'Defines>
val axis : Axis2D<Meters,Cartesian>
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
Multiple items
union case Meters.Meters: Meters

--------------------
type Meters = | Meters
<category>Unit</category>
val through : origin:Point2D<'Units,'Coordinates> -> direction:Direction2D<'Coordinates> -> Axis2D<'Units,'Coordinates>
val pi : Angle
<category>Constants</category>
π
val fromXAxis : givenAxis:Axis2D<'Units,'Coordinates> -> Frame2D<'Units,'Coordinates,'c>
<summary> Construct a `Frame2d` given its X axis `Frame2d.fromXAxis axis` is equivalent to `Frame2d.withXDirection (Axis2d.direction axis) (Axis2d.originPoint axis)` </summary>
val fromYAxis : givenAxis:Axis2D<'Units,'Coordinates> -> Frame2D<'Units,'Coordinates,'Defines>
<summary> Construct a `Frame2d` given its Y axis; `Frame2d.fromYAxis axis` is equivalent to `Frame2d.withYDirection (Axis2d.direction axis) (Axis2d.originPoint axis)` </summary>
val frame : Frame2D<Meters,Cartesian,unit>
type unit = Unit
<summary>The type 'unit', which has only one value "()". This value is special and always uses the representation 'null'.</summary>
<category index="1">Basic Types</category>
val originPoint : frame:Frame2D<'Units,'Coordinates,'Defines> -> Point2D<'Units,'Coordinates>
Frame2D.Origin: Point2D<Meters,Cartesian>
val xDirection : frame:Frame2D<'Units,'Coordinates,'Defines> -> Direction2D<'Coordinates>
Frame2D.XDirection: Direction2D<Cartesian>
val yDirection : frame:Frame2D<'Units,'Coordinates,'Defines> -> Direction2D<'Coordinates>
Frame2D.YDirection: Direction2D<Cartesian>
val isRightHanded : frame:Frame2D<'Units,'Coordinates,'Defines> -> bool
<summary> Check if a frame is [right-handed](https://en.wikipedia.org/wiki/Cartesian_coordinate_system#Orientation_and_handedness). All predefined frames are right-handed, and most operations on frames preserve handedness, so about the only ways to end up with a left-handed frame are by constructing one explicitly with `unsafe` or by mirroring a right-handed frame. </summary>
val yAxis : frame:Frame2D<'Units,'Coordinates,'Defines> -> Axis2D<'Units,'Coordinates>
<summary> Get the Y axis of a given frame (the axis formed from the frame's origin point and Y direction). </summary>
val xAxis : frame:Frame2D<'Units,'Coordinates,'Defines> -> Axis2D<'Units,'Coordinates>
<summary> Get the X axis of a given frame (the axis formed from the frame's origin point and X direction). </summary>
val reverseX : frame:Frame2D<'Units,'Coordinates,'Defines> -> Frame2D<'Units,'Coordinates,'Defines>
<summary> Reverse the X direction of a frame, leaving its Y direction and origin point the same. Note that this will switch the [handedness](https://en.wikipedia.org/wiki/Cartesian_coordinate_system#Orientation_and_handedness) of the frame. </summary>
val reverseY : frame:Frame2D<'Units,'Coordinates,'Defines> -> Frame2D<'Units,'Coordinates,'Defines>
<summary> Reverse the Y direction of a frame, leaving its X direction and origin point the same. Note that this will switch the [handedness](https://en.wikipedia.org/wiki/Cartesian_coordinate_system#Orientation_and_handedness) of the frame. </summary>
val moveTo : newOrigin:Point2D<'Units,'Coordinates> -> frame:Frame2D<'Units,'Coordinates,'Defines> -> Frame2D<'Units,'Coordinates,'Defines>
<summary> Move a frame so that it has the given origin point. </summary>
val origin<'Units,'Coordinates> : Point2D<'Units,'Coordinates>
val rotateBy : angle:Angle -> frame:Frame2D<'Units,'Coordinates,'Defines> -> Frame2D<'Units,'Coordinates,'Defines>
<summary> Rotate a frame counterclockwise by a given angle around the frame's own origin point. The resulting frame will have the same origin point, and its X and Y directions will be rotated by the given angle. </summary>
val rotateAround : centerPoint:Point2D<'Units,'Coordinates> -> angle:Angle -> frame:Frame2D<'Units,'Coordinates,'Defines> -> Frame2D<'Units,'Coordinates,'Defines>
<summary> Rotate a frame counterclockwise around a given point by a given angle. The frame's origin point will be rotated around the given point by the given angle, and its X and Y basis directions will be rotated by the given angle. </summary>
val translateBy : vector:Vector2D<'Units,'Coordinates> -> frame:Frame2D<'Units,'Coordinates,'Defines> -> Frame2D<'Units,'Coordinates,'Defines>
<summary> Translate a frame by a given displacement. </summary>
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 translateIn : direction:Direction2D<'Coordinates> -> distance:Quantity<'Units> -> frame:Frame2D<'Units,'Coordinates,'Defines> -> Frame2D<'Units,'Coordinates,'Defines>
<summary> Translate a frame in a given direction by a given distance. </summary>
val translateAlongOwn : axis:(Frame2D<'Units,'Coordinates,'Defines1> -> Axis2D<'Units,'Coordinates>) -> distance:Quantity<'Units> -> frame:Frame2D<'Units,'Coordinates,'Defines1> -> Frame2D<'Units,'Coordinates,'Defines2>
<summary> Translate a frame along one of its own axes by a given distance. The first argument is a function that returns the axis to translate along, given the current frame. The majority of the time this argument will be either `Frame2d.xAxis` or `Frame2d.yAxis`. The second argument is the distance to translate along the given axis. </summary>
val mirrorAcross : axis:Axis2D<'Units,'Coordinates> -> frame:Frame2D<'Units,'Coordinates,'Defines> -> Frame2D<'Units,'Coordinates,'Defines>
<summary> Mirror a frame across an axis. Note that this will switch the [handedness](https://en.wikipedia.org/wiki/Cartesian_coordinate_system#Orientation_and_handedness) of the frame. </summary>
val relativeTo : otherFrame:Frame2D<'Units,'GlobalCoordinates,'LocalCoordinates> -> frame:Frame2D<'Units,'GlobalCoordinates,'LocalCoordinates> -> Frame2D<'Units,'LocalCoordinates,'GlobalCoordinates>
<summary> Take two frames defined in global coordinates, and return the second one expressed in local coordinates relative to the first. </summary>
val placeIn : reference:Frame2D<'Units,'GlobalCoordinates,'LocalCoordinates> -> frame:Frame2D<'Units,'LocalCoordinates,'GlobalCoordinates> -> Frame2D<'Units,'GlobalCoordinates,'LocalCoordinates>
<summary> Take one frame defined in global coordinates and a second frame defined in local coordinates relative to the first frame, and return the second frame expressed in global coordinates. </summary>