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

Safe Haskell | None
Language | Haskell2010

Graphics.Gloss.Data.Vector

Description

Geometric functions concerning vectors.

Synopsis

- type Vector = Point
- magV :: Vector -> Float
- argV :: Vector -> Float
- dotV :: Vector -> Vector -> Float
- detV :: Vector -> Vector -> Float
- mulSV :: Float -> Vector -> Vector
- rotateV :: Float -> Vector -> Vector
- angleVV :: Vector -> Vector -> Float
- normalizeV :: Vector -> Vector
- unitVectorAtAngle :: Float -> Vector

# Documentation

type Vector = Point Source #

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.