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

Copyright(c) 2013 diagrams-lib team (see LICENSE)
LicenseBSD-style (see LICENSE)
Maintainerdiagrams-discuss@googlegroups.com
Safe HaskellNone
LanguageHaskell2010

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 Double Source

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 Double Source

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 Double Source

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 :: Angle Source

An angle representing one full turn.

fullCircle :: Angle Source

Deprecated synonym for fullTurn, retained for backwards compatibility.

angleRatio :: Angle -> Angle -> Double Source

Calculate ratio between two angles.

sinA :: Angle -> Double Source

The sine of the given Angle.

cosA :: Angle -> Double Source

The cosine of the given Angle.

tanA :: Angle -> Double Source

The tangent function of the given Angle.

asinA :: Double -> Angle Source

The Angle with the given sine.

acosA :: Double -> Angle Source

The Angle with the given cosine.

atanA :: Double -> Angle Source

The Angle with the given tangent.

(@@) :: b -> Iso' a b -> a infixl 5 Source

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 -> Angle Source

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

class HasTheta t where Source

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

Minimal complete definition

Nothing

Methods

_theta :: Lens' t Angle Source