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

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.

Instances

 Enum Angle Eq Angle Ord Angle Read Angle Show Angle VectorSpace Angle AdditiveGroup Angle type Scalar Angle = Double

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

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`.

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

An angle representing one full turn.

Deprecated synonym for `fullTurn`, retained for backwards compatibility.

Calculate ratio between two angles.

The sine of the given `Angle`.

The cosine of the given `Angle`.

The tangent function of the given `Angle`.

The `Angle` with the given sine.

The `Angle` with the given cosine.

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. `Angle`s 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

Instances

 HasTheta P2 HasTheta R2 HasTheta Direction HasTheta P3 HasTheta R3