vector-space-0.4: Vector & affine spaces, linear maps, and derivatives (requires ghc 6.9)

Stabilityexperimental
Maintainerconal@conal.net, andygill@ku.edu

Data.AffineSpace

Description

Affine spaces.

Synopsis

Documentation

class VectorSpace v s => AffineSpace p v s | p -> v s whereSource

Methods

(.-.) :: p -> p -> vSource

Subtract points

(.+^) :: p -> v -> pSource

Point plus vector

(.-^) :: (Num s, AffineSpace p v s) => p -> v -> pSource

Point minus vector

distanceSq :: (AffineSpace p v s, InnerSpace v s) => p -> p -> sSource

Square of the distance between two points. Sometimes useful for efficiency. See also distance.

distance :: (Floating s, AffineSpace p v s, InnerSpace v s) => p -> p -> sSource

Distance between two points. See also distanceSq.

alerp :: AffineSpace p v s => p -> p -> s -> pSource

Affine linear interpolation. Varies from p to p' as s varies from 0 to 1. See also lerp (on vector spaces).