ianmackenzie/elm-units/2.0.2

NOTE: the latest version is 2.10.0

Angle

An Angle represents an angle in degrees, radians, or turns. It is stored as a number of radians.

type alias Angle =
type Radians

Conversions

radians : Float -> Angle

Construct an angle from a number of radians.

inRadians : Angle -> Float

Convert an angle to a number of radians.

degrees : Float -> Angle

Construct an angle from a number of degrees.

Angle.degrees 180
--> Angle.radians pi
inDegrees : Angle -> Float

Convert an angle to a number of degrees.

Angle.turns 2 |> Angle.inDegrees
--> 720
turns : Float -> Angle

Construct an angle from a number of turns.

Angle.turns -0.25
--> Angle.degrees -90
inTurns : Angle -> Float

Convert an angle to a number of turns.

Angle.radians pi |> Angle.inTurns
--> 0.5

Trigonometry

If you're using Angle values instead of plain Floats, you'll need to use these functions instead of the corresponding ones in core.

sin : Angle -> Float
cos : Angle -> Float
tan : Angle -> Float
asin : Float -> Angle
acos : Float -> Angle
atan : Float -> Angle
atan2 : Quantity Float units -> Quantity Float units -> Angle