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

Copyright | (c) Conal Elliott 2008
License | BSD3
Maintainer | conal@conal.net
Stability | experimental
Safe Haskell | None
Language | Haskell2010

Data.Cross

Description

Cross products and normals

Synopsis

- class HasNormal v where
  - normalVec :: v -> v
- normal :: (HasNormal v, InnerSpace v, Floating (Scalar v)) => v -> v
- type One s = s
- type Two s = (s, s)
- type Three s = (s, s, s)
- class HasCross2 v where
  - cross2 :: v -> v
- class HasCross3 v where
  - cross3 :: v -> v -> v

# Documentation

class HasNormal v where Source #

Thing with a normal vector (not necessarily normalized).

Methods

normalVec :: v -> v Source #

#### Instances

Instances details

(VectorSpace s, HasBasis s, HasTrie (Basis s), HasNormal (Two s :> Three s)) => HasNormal (Three (Two s :> s)) Source # |
Instance details Defined in Data.Cross 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 # |
Instance details Defined in Data.Cross Methods normalVec :: Two (One s :> s) -> Two (One s :> s) Source #
(HasBasis s, HasTrie (Basis s), Basis s ~ ()) => HasNormal (One s :> Two s) Source # |
Instance details Defined in Data.Cross Methods normalVec :: (One s :> Two s) -> One s :> Two s Source #
(Num s, HasTrie (Basis (s, s)), HasBasis s, Basis s ~ ()) => HasNormal (Two s :> Three s) Source # |
Instance details Defined in Data.Cross Methods normalVec :: (Two s :> Three s) -> Two s :> Three 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

Methods

cross2 :: v -> v Source #

#### Instances

Instances details

(HasTrie (Basis a), HasCross2 v) => HasCross2 (a :> v) Source # |
Instance details Defined in Data.Cross Methods cross2 :: (a :> v) -> a :> v Source #
AdditiveGroup u => HasCross2 (u, u) Source # |
Instance details Defined in Data.Cross Methods cross2 :: (u, u) -> (u, u) Source #

class HasCross3 v where Source #

Cross product of various forms of 3D vectors

Methods

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

#### Instances

Instances details

(HasBasis a, HasTrie (Basis a), VectorSpace v, HasCross3 v) => HasCross3 (a :> v) Source # |
Instance details Defined in Data.Cross Methods cross3 :: (a :> v) -> (a :> v) -> a :> v Source #
Num s => HasCross3 (s, s, s) Source # |
Instance details Defined in Data.Cross Methods cross3 :: (s, s, s) -> (s, s, s) -> (s, s, s) Source #