This package is intended to be a port and extension of the framework elm-geometry.
It focuses on providing as many interfaces for geometric objects an manipulation in a way that is type safe and
convenient.
This framework is currently in alpha development and is currently working on building out 2D development and
functionality first before moving to expand into 3D objects.
To use this framework you include the package through the namespace
open Math.Geometry
open Math.Units
You can then create a variety of geometric objects like points, vectors, angles, ...
Point2D.pixels 100. 200.
Vector2D.meters 4. 4.
Angle.degrees 30.
namespace Math
namespace Math.Geometry
namespace Math.Units
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 pixels : x:float -> y:float -> Point2D<Meters,'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>
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.