Math.Geometry


Axis 2D

An axis is a line that goes through a point at a particular angle.

Constants

Axis2D.x
Axis2D.y

Builders

For the following, the input direction that will be used is

let direction: Direction2D<Cartesian> = Direction2D.fromAngle (Angle.degrees 45.)
No value returned by any evaluator
Axis2D.through (Point2D.meters 3. 3.) direction
No value returned by any evaluator
Axis2D.withDirection direction (Point2D.meters 3. 3.)
No value returned by any evaluator
Axis2D.throughPoints (Point2D.meters 3. 3.) (Point2D.meters 5. 5.)
No value returned by any evaluator

Accessors

To show the output of the accessor methods, the following axis will be used.

let axis = Axis2D.through (Point2D.meters 3. 3.) direction
No value returned by any evaluator
Axis2D.originPoint axis // or
axis.Origin
No value returned by any evaluator
Axis2D.direction axis // or
axis.Direction
No value returned by any evaluator

Modifiers

Axis2D.reverse axis
No value returned by any evaluator
Axis2D.moveTo (Point2D.meters -1. 4.) axis
No value returned by any evaluator
Axis2D.rotateAround Point2D.origin Angle.pi axis
No value returned by any evaluator
Axis2D.rotateBy
Axis2D.translateBy
Axis2D.translateIn
Axis2D.mirrorAcross
Axis2D.relativeTo
Axis2D.placeIn
namespace Math
namespace Math.Geometry
namespace Math.Units
Multiple items
union case Cartesian.Cartesian: Cartesian

--------------------
type Cartesian = | 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
val x<'Units,'Coordinates> : Axis2D<'Units,'Coordinates>
val y<'Units,'Coordinates> : Axis2D<'Units,'Coordinates>
val direction : Direction2D<Cartesian>
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 through : origin:Point2D<'Units,'Coordinates> -> direction:Direction2D<'Coordinates> -> Axis2D<'Units,'Coordinates>
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 withDirection : direction:Direction2D<'Coordinates> -> point:Point2D<'Units,'Coordinates> -> Axis2D<'Units,'Coordinates>
val throughPoints : first:Point2D<'Units,'Coordinates> -> second:Point2D<'Units,'Coordinates> -> Axis2D<'Units,'Coordinates> option
val axis : Axis2D<Meters,Cartesian>
val originPoint : axis:Axis2D<'Units,'Coordinates> -> Point2D<'Units,'Coordinates>
<summary> Get the origin point of the axis. </summary>
Axis2D.Origin: Point2D<Meters,Cartesian>
val direction : axis:Axis2D<'Units,'Coordinates> -> Direction2D<'Coordinates>
<summary> Get the direction of the axis. </summary>
Axis2D.Direction: Direction2D<Cartesian>
val reverse : axis:Axis2D<'Units,'Coordaintes> -> Axis2D<'Units,'Coordaintes>
<summary> Reverse the direction of the axis. </summary>
val moveTo : point:Point2D<'Units,'Coordinates> -> axis:Axis2D<'Units,'Coordinates> -> Axis2D<'Units,'Coordinates>
<summary> Move the origin to have a different origin point but the same direction. </summary>
val rotateAround : center:Point2D<'Units,'Coordinates> -> angle:Angle -> axis:Axis2D<'Units,'Coordinates> -> Axis2D<'Units,'Coordinates>
<summary> Rotate an axis around a given center point by a given angle. Rotates the axis' origin point around the given point by the given angle and the axis' direction by the given angle. </summary>
val origin<'Units,'Coordinates> : Point2D<'Units,'Coordinates>
val pi : Angle
<category>Constants</category>
π
val rotateBy : angle:Angle -> axis:Axis2D<'Units,'Coordinates> -> Axis2D<'Units,'Coordinates>
<summary> Rotate an axis around its own origin point by the given angle. </summary>
val translateBy : vector:Vector2D<'Units,'Coordinates> -> axis:Axis2D<'Units,'Coordinates> -> Axis2D<'Units,'Coordinates>
<summary> Translate an axis by a given displacement. Applies the given displacement to the axis' origin point and leaves the direction unchanged. </summary>
val translateIn : translationDirection:Direction2D<'Coordinates> -> distance:Quantity<'Units> -> axis:Axis2D<'Units,'Coordinates> -> Axis2D<'Units,'Coordinates>
<summary> Translate an axis in a given direction by a given distance. </summary>
val mirrorAcross : otherAxis:Axis2D<'Units,'Coordinates> -> axis:Axis2D<'Units,'Coordinates> -> Axis2D<'Units,'Coordinates>
<summary> Mirror one axis across another. The axis to mirror across is given first and the axis to mirror is given second. Axis2D.mirrorAcross Axis2D.x exampleAxis --&gt; Axis2D.through (Point2D.meters 1. -3.) --&gt; (Direction2D.degrees -30.) </summary>
val relativeTo : frame:Frame2D<'Units,'GlobalCoordinates,'LocalCoordinates> -> axis:Axis2D<'Units,'GlobalCoordinates> -> Axis2D<'Units,'LocalCoordinates>
<summary> Take an axis 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> -> axis:Axis2D<'Units,'LocalCoordinates> -> Axis2D<'Units,'GlobalCoordinates>
<summary> Take an axis defined in local coordinates relative to a given reference frame, and return that axis expressed in global coordinates. </summary>