vector-space-0.8.7: Vector & affine spaces, linear maps, and derivatives

Stabilityexperimental
Maintainerconal@conal.net
Safe HaskellNone

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