diagrams-lib-1.2.0.2: Embedded domain-specific language for declarative graphics

Maintainerdiagrams-discuss@googlegroups.com
Safe HaskellNone

Diagrams.Angle

Description

Type for representing angles, independent of vector-space

Synopsis

Documentation

data Angle Source

Angles can be expressed in a variety of units. Internally, they are represented in radians.

rad :: Iso' Angle DoubleSource

The radian measure of an Angle a can be accessed as a ^. rad. A new Angle can be defined in radians as pi @@ rad.

turn :: Iso' Angle DoubleSource

The measure of an Angle a in full circles can be accessed as a ^. turn. A new Angle of one-half circle can be defined in as 1/2 @@ turn.

deg :: Iso' Angle DoubleSource

The degree measure of an Angle a can be accessed as a ^. deg. A new Angle can be defined in degrees as 180 @@ deg.

fullTurn :: AngleSource

An angle representing one full turn.

fullCircle :: AngleSource

Deprecated synonym for fullTurn, retained for backwards compatibility.

angleRatio :: Angle -> Angle -> DoubleSource

Calculate ratio between two angles.

sinA :: Angle -> DoubleSource

The sine of the given Angle.

cosA :: Angle -> DoubleSource

The cosine of the given Angle.

tanA :: Angle -> DoubleSource

The tangent function of the given Angle.

asinA :: Double -> AngleSource

The Angle with the given sine.

acosA :: Double -> AngleSource

The Angle with the given cosine.

atanA :: Double -> AngleSource

The Angle with the given tangent.

(@@) :: b -> Iso' a b -> aSource

30 @@ deg is an Angle of the given measure and units.

More generally, @@ reverses the Iso' on its right, and applies the Iso' to the value on the left. Angles are the motivating example where this order improves readability.

angleBetween :: (InnerSpace v, Scalar v ~ Double) => v -> v -> AngleSource

compute the positive angle between the two vectors in their common plane

class HasTheta t whereSource

The class of types with at least one angle coordinate, called _theta.