vector-space-0.12: 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).

Minimal complete definition

normalVec

Methods

normalVec :: v -> v Source #

Instances

(VectorSpace s, HasBasis s, HasTrie (Basis s), HasNormal ((:>) (Two s) (Three s))) => HasNormal (Three ((:>) (Two s) s)) Source # 

Methods

normalVec :: Three (Two s :> s) -> Three (Two s :> s) Source #

(VectorSpace s, HasBasis s, HasTrie (Basis s), (~) * (Basis s) ()) => HasNormal (Two ((:>) (One s) s)) Source # 

Methods

normalVec :: Two (One s :> s) -> Two (One s :> s) Source #

(Num s, HasTrie (Basis (s, s)), HasBasis s, (~) * (Basis s) ()) => HasNormal ((:>) (Two s) (Three s)) Source # 

Methods

normalVec :: (Two s :> Three s) -> Two s :> Three s Source #

(HasBasis s, HasTrie (Basis s), (~) * (Basis s) ()) => HasNormal ((:>) (One s) (Two s)) Source # 

Methods

normalVec :: (One s :> Two s) -> One s :> Two s Source #

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

Minimal complete definition

cross2

Methods

cross2 :: v -> v Source #

Instances

AdditiveGroup u => HasCross2 (u, u) Source # 

Methods

cross2 :: (u, u) -> (u, u) Source #

(HasTrie (Basis a), HasCross2 v) => HasCross2 ((:>) a v) Source # 

Methods

cross2 :: (a :> v) -> a :> v Source #

class HasCross3 v where Source #

Cross product of various forms of 3D vectors

Minimal complete definition

cross3

Methods

cross3 :: v -> v -> v Source #

Instances

(HasBasis a, HasTrie (Basis a), VectorSpace v, HasCross3 v) => HasCross3 ((:>) a v) Source # 

Methods

cross3 :: (a :> v) -> (a :> v) -> a :> v Source #

Num s => HasCross3 (s, s, s) Source # 

Methods

cross3 :: (s, s, s) -> (s, s, s) -> (s, s, s) Source #