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

Maintainerdiagrams-discuss@googlegroups.com
Safe HaskellSafe-Infered

Diagrams.TwoD.Vector

Contents

Description

Two-dimensional vectors.

Synopsis

Special 2D vectors

unitX :: R2Source

The unit vector in the positive X direction.

unitY :: R2Source

The unit vector in the positive Y direction.

unit_X :: R2Source

The unit vector in the negative X direction.

unit_Y :: R2Source

The unit vector in the negative Y direction.

Converting between vectors and angles

direction :: Angle a => R2 -> aSource

Compute the direction of a vector, measured counterclockwise from the positive x-axis as a fraction of a full turn. The zero vector is arbitrarily assigned the direction 0.

fromDirection :: Angle a => a -> R2Source

Convert an angle into a unit vector pointing in that direction.

e :: Angle a => a -> R2Source

A convenient synonym for fromDirection.