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

Stabilityexperimental
Maintainerconal@conal.net

Data.Cross

Description

Cross products and normals

Synopsis

Documentation

class HasNormal v whereSource

Thing with a normal vector (not necessarily normalized).

Methods

normalVec :: v -> vSource

Instances

(Num s, VectorSpace s, HasBasis s, HasTrie (Basis s), HasNormal (:> (Two s) (Three s))) => HasNormal (Three (:> (Two s) s)) 
(Basis s ~ (), Num s, VectorSpace s, HasBasis s, HasTrie (Basis s)) => HasNormal (Two (:> (One s) s)) 
(Basis s ~ (), Num s, HasTrie (Basis (s, s)), HasBasis s) => HasNormal (:> (Two s) (Three s)) 
(Basis s ~ (), HasBasis s, HasTrie (Basis s)) => HasNormal (:> (One s) (Two s)) 

normal :: (HasNormal v, InnerSpace v, Floating (Scalar v)) => v -> vSource

Normalized normal vector. See also cross.

type One s = sSource

Singleton

type Two s = (s, s)Source

Homogeneous pair

type Three s = (s, s, s)Source

Homogeneous triple

class HasCross2 v whereSource

Cross product of various forms of 2D vectors

Methods

cross2 :: v -> vSource

Instances

class HasCross3 v whereSource

Cross product of various forms of 3D vectors

Methods

cross3 :: v -> v -> vSource

Instances

(HasBasis a, HasTrie (Basis a), VectorSpace v, HasCross3 v) => HasCross3 (:> a v) 
Num s => HasCross3 (s, s, s)