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

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 # MethodsnormalVec :: Three (Two s :> s) -> Three (Two s :> s) Source # (VectorSpace s, HasBasis s, HasTrie (Basis s), (~) * (Basis s) ()) => HasNormal (Two ((:>) (One s) s)) Source # MethodsnormalVec :: 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 # MethodsnormalVec :: (Two s :> Three s) -> Two s :> Three s Source # (HasBasis s, HasTrie (Basis s), (~) * (Basis s) ()) => HasNormal ((:>) (One s) (Two s)) Source # MethodsnormalVec :: (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 # Methodscross2 :: (u, u) -> (u, u) Source # (HasTrie (Basis a), HasCross2 v) => HasCross2 ((:>) a v) Source # Methodscross2 :: (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 # Methodscross3 :: (a :> v) -> (a :> v) -> a :> v Source # Num s => HasCross3 (s, s, s) Source # Methodscross3 :: (s, s, s) -> (s, s, s) -> (s, s, s) Source #