gloss- Painless 2D vector graphics, animations and simulations.

Safe HaskellNone



Geometric functions concerning vectors.



type Vector = Point #

A vector can be treated as a point, and vis-versa.

magV :: Vector -> Float Source #

The magnitude of a vector.

argV :: Vector -> Float Source #

The angle of this vector, relative to the +ve x-axis.

dotV :: Vector -> Vector -> Float Source #

The dot product of two vectors.

detV :: Vector -> Vector -> Float Source #

The determinant of two vectors.

mulSV :: Float -> Vector -> Vector Source #

Multiply a vector by a scalar.

rotateV :: Float -> Vector -> Vector Source #

Rotate a vector by an angle (in radians). +ve angle is counter-clockwise.

angleVV :: Vector -> Vector -> Float Source #

Compute the inner angle (in radians) between two vectors.

normalizeV :: Vector -> Vector Source #

Normalise a vector, so it has a magnitude of 1.

unitVectorAtAngle :: Float -> Vector Source #

Produce a unit vector at a given angle relative to the +ve x-axis. The provided angle is in radians.