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

Copyright(c) Conal Elliott 2008
LicenseBSD3
Maintainerconal@conal.net
Stabilityexperimental
Safe HaskellNone
LanguageHaskell98

Data.Cross

Description

Cross products and normals

Synopsis

Documentation

class HasNormal v where Source

Thing with a normal vector (not necessarily normalized).

Methods

normalVec :: v -> v Source

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 -> v Source

Normalized normal vector. See also cross.

type One s = s Source

Singleton

type Two s = (s, s) Source

Homogeneous pair

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

Homogeneous triple

class HasCross2 v where Source

Cross product of various forms of 2D vectors

Methods

cross2 :: v -> v Source

Instances

class HasCross3 v where Source

Cross product of various forms of 3D vectors

Methods

cross3 :: v -> v -> v Source

Instances

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