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

Maintainerdiagrams-discuss@googlegroups.com

Diagrams.TwoD.Types

Contents

Description

Basic types for two-dimensional Euclidean space.

Synopsis

2D Euclidean space

type R2 = (Double, Double)Source

The two-dimensional Euclidean vector space R^2.

type P2 = Point R2Source

Points in R^2.

type T2 = Transformation R2Source

Transformations in R^2.

Angles

class Num a => Angle a whereSource

Type class for types that measure angles.

Methods

toCircleFrac :: a -> CircleFracSource

Convert to a fraction of a circle.

fromCircleFrac :: CircleFrac -> aSource

Convert from a fraction of a circle.

Instances

Angle Deg

360 degrees = 1 full circle.

Angle Rad

tau radians = 1 full circle.

Angle CircleFrac 

newtype CircleFrac Source

Newtype wrapper used to represent angles as fractions of a circle. For example, 13 = tau3 radians = 120 degrees.

Constructors

CircleFrac 

newtype Rad Source

Newtype wrapper for representing angles in radians.

Constructors

Rad 

Fields

getRad :: Double
 

Instances

newtype Deg Source

Newtype wrapper for representing angles in degrees.

Constructors

Deg 

Fields

getDeg :: Double
 

Instances

fullCircle :: Angle a => aSource

An angle representing a full circle.

convertAngle :: (Angle a, Angle b) => a -> bSource

Convert between two angle representations.