gloss-1.13.2.1: 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 #

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

magV :: Vector -> Float #

The magnitude of a vector.

argV :: Vector -> Float #

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

dotV :: Vector -> Vector -> Float #

The dot product of two vectors.

detV :: Vector -> Vector -> Float #

The determinant of two vectors.

mulSV :: Float -> Vector -> Vector #

Multiply a vector by a scalar.

rotateV :: Float -> Vector -> Vector #

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

angleVV :: Vector -> Vector -> Float #

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

normalizeV :: Vector -> Vector #

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

unitVectorAtAngle :: Float -> Vector #

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