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

Stability experimental conal@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 s, HasBasis s s, HasTrie (Basis s), HasNormal (:> (Two s) (Three s))) => HasNormal (Three (:> (Two s) s)) (Basis s ~ (), Num s, VectorSpace s s, HasBasis s s, HasTrie (Basis s)) => HasNormal (Two (:> (One s) s)) (Basis s ~ (), Num s, HasTrie (Basis (s, s)), HasBasis s s) => HasNormal (:> (Two s) (Three s)) (Basis s ~ (), HasBasis s s, HasTrie (Basis s)) => HasNormal (:> (One s) (Two s))

normal :: (HasNormal v, InnerSpace v s, Floating s) => 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

 AdditiveGroup u => HasCross2 (u, u) (HasBasis a s, HasTrie (Basis a), VectorSpace v s, HasCross2 v) => HasCross2 (:> a v)

class HasCross3 v whereSource

Cross product of various forms of 3D vectors

Methods

cross3 :: v -> v -> vSource

Instances

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