linear-1.20.5: Linear Algebra

Copyright(C) 2012-2015 Edward Kmett
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellTrustworthy
LanguageHaskell98

Linear.V4

Description

4-D Vectors

Synopsis

Documentation

data V4 a

A 4-dimensional vector.

Constructors

V4 !a !a !a !a 

Instances

Monad V4 
Functor V4 
MonadFix V4 
Applicative V4 
Foldable V4 
Traversable V4 
Generic1 V4 
Distributive V4 
Representable V4 
MonadZip V4 
Serial1 V4 
Traversable1 V4 
Apply V4 
Bind V4 
Foldable1 V4 
Eq1 V4 
Ord1 V4 
Read1 V4 
Show1 V4 
Additive V4 
Metric V4 
R1 V4 
R2 V4 
R3 V4 
R4 V4 
Trace V4 
Affine V4 
Unbox a => Vector Vector (V4 a) 
Unbox a => MVector MVector (V4 a) 
Num r => Coalgebra r (E V4) 
Bounded a => Bounded (V4 a) 
Eq a => Eq (V4 a) 
Floating a => Floating (V4 a) 
Fractional a => Fractional (V4 a) 
Data a => Data (V4 a) 
Num a => Num (V4 a) 
Ord a => Ord (V4 a) 
Read a => Read (V4 a) 
Show a => Show (V4 a) 
Ix a => Ix (V4 a) 
Generic (V4 a) 
Storable a => Storable (V4 a) 
Binary a => Binary (V4 a) 
Serial a => Serial (V4 a) 
Serialize a => Serialize (V4 a) 
NFData a => NFData (V4 a) 
Hashable a => Hashable (V4 a) 
Unbox a => Unbox (V4 a) 
Ixed (V4 a) 
Epsilon a => Epsilon (V4 a) 
FunctorWithIndex (E V4) V4 
FoldableWithIndex (E V4) V4 
TraversableWithIndex (E V4) V4 
Each (V4 a) (V4 b) a b 
type Rep1 V4 
type Rep V4 = E V4 
type Diff V4 = V4 
data MVector s (V4 a) = MV_V4 !Int !(MVector s a) 
type Rep (V4 a) 
data Vector (V4 a) = V_V4 !Int !(Vector a) 
type Index (V4 a) = E V4 
type IxValue (V4 a) = a 

vector :: Num a => V3 a -> V4 a

Convert a 3-dimensional affine vector into a 4-dimensional homogeneous vector, i.e. sets the w coordinate to 0.

point :: Num a => V3 a -> V4 a

Convert a 3-dimensional affine point into a 4-dimensional homogeneous vector, i.e. sets the w coordinate to 1.

normalizePoint :: Fractional a => V4 a -> V3 a

Convert 4-dimensional projective coordinates to a 3-dimensional point. This operation may be denoted, euclidean [x:y:z:w] = (x/w, y/w, z/w) where the projective, homogenous, coordinate [x:y:z:w] is one of many associated with a single point (x/w, y/w, z/w).

class R1 t where

A space that has at least 1 basis vector _x.

Minimal complete definition

Nothing

Methods

_x :: Lens' (t a) a

>>> V1 2 ^._x
2
>>> V1 2 & _x .~ 3
V1 3

Instances

R1 Identity 
R1 V1 
R1 V2 
R1 V3 
R1 V4 
R1 f => R1 (Point f) 

class R1 t => R2 t where

A space that distinguishes 2 orthogonal basis vectors _x and _y, but may have more.

Minimal complete definition

Nothing

Methods

_y :: Lens' (t a) a

>>> V2 1 2 ^._y
2
>>> V2 1 2 & _y .~ 3
V2 1 3

_xy :: Lens' (t a) (V2 a)

Instances

R2 V2 
R2 V3 
R2 V4 
R2 f => R2 (Point f) 

_yx :: R2 t => Lens' (t a) (V2 a)

>>> V2 1 2 ^. _yx
V2 2 1

class R2 t => R3 t where

A space that distinguishes 3 orthogonal basis vectors: _x, _y, and _z. (It may have more)

Minimal complete definition

Nothing

Methods

_z :: Lens' (t a) a

>>> V3 1 2 3 ^. _z
3

_xyz :: Lens' (t a) (V3 a)

Instances

R3 V3 
R3 V4 
R3 f => R3 (Point f) 

_xz :: R3 t => Lens' (t a) (V2 a)

_yz :: R3 t => Lens' (t a) (V2 a)

_zx :: R3 t => Lens' (t a) (V2 a)

_zy :: R3 t => Lens' (t a) (V2 a)

_xzy :: R3 t => Lens' (t a) (V3 a)

_yxz :: R3 t => Lens' (t a) (V3 a)

_yzx :: R3 t => Lens' (t a) (V3 a)

_zxy :: R3 t => Lens' (t a) (V3 a)

_zyx :: R3 t => Lens' (t a) (V3 a)

class R3 t => R4 t where

A space that distinguishes orthogonal basis vectors _x, _y, _z, _w. (It may have more.)

Minimal complete definition

Nothing

Methods

_w :: Lens' (t a) a

>>> V4 1 2 3 4 ^._w
4

_xyzw :: Lens' (t a) (V4 a)

Instances

R4 V4 
R4 f => R4 (Point f) 

_xw :: R4 t => Lens' (t a) (V2 a)

_yw :: R4 t => Lens' (t a) (V2 a)

_zw :: R4 t => Lens' (t a) (V2 a)

_wx :: R4 t => Lens' (t a) (V2 a)

_wy :: R4 t => Lens' (t a) (V2 a)

_wz :: R4 t => Lens' (t a) (V2 a)

_xyw :: R4 t => Lens' (t a) (V3 a)

_xzw :: R4 t => Lens' (t a) (V3 a)

_xwy :: R4 t => Lens' (t a) (V3 a)

_xwz :: R4 t => Lens' (t a) (V3 a)

_yxw :: R4 t => Lens' (t a) (V3 a)

_yzw :: R4 t => Lens' (t a) (V3 a)

_ywx :: R4 t => Lens' (t a) (V3 a)

_ywz :: R4 t => Lens' (t a) (V3 a)

_zxw :: R4 t => Lens' (t a) (V3 a)

_zyw :: R4 t => Lens' (t a) (V3 a)

_zwx :: R4 t => Lens' (t a) (V3 a)

_zwy :: R4 t => Lens' (t a) (V3 a)

_wxy :: R4 t => Lens' (t a) (V3 a)

_wxz :: R4 t => Lens' (t a) (V3 a)

_wyx :: R4 t => Lens' (t a) (V3 a)

_wyz :: R4 t => Lens' (t a) (V3 a)

_wzx :: R4 t => Lens' (t a) (V3 a)

_wzy :: R4 t => Lens' (t a) (V3 a)

_xywz :: R4 t => Lens' (t a) (V4 a)

_xzyw :: R4 t => Lens' (t a) (V4 a)

_xzwy :: R4 t => Lens' (t a) (V4 a)

_xwyz :: R4 t => Lens' (t a) (V4 a)

_xwzy :: R4 t => Lens' (t a) (V4 a)

_yxzw :: R4 t => Lens' (t a) (V4 a)

_yxwz :: R4 t => Lens' (t a) (V4 a)

_yzxw :: R4 t => Lens' (t a) (V4 a)

_yzwx :: R4 t => Lens' (t a) (V4 a)

_ywxz :: R4 t => Lens' (t a) (V4 a)

_ywzx :: R4 t => Lens' (t a) (V4 a)

_zxyw :: R4 t => Lens' (t a) (V4 a)

_zxwy :: R4 t => Lens' (t a) (V4 a)

_zyxw :: R4 t => Lens' (t a) (V4 a)

_zywx :: R4 t => Lens' (t a) (V4 a)

_zwxy :: R4 t => Lens' (t a) (V4 a)

_zwyx :: R4 t => Lens' (t a) (V4 a)

_wxyz :: R4 t => Lens' (t a) (V4 a)

_wxzy :: R4 t => Lens' (t a) (V4 a)

_wyxz :: R4 t => Lens' (t a) (V4 a)

_wyzx :: R4 t => Lens' (t a) (V4 a)

_wzxy :: R4 t => Lens' (t a) (V4 a)

_wzyx :: R4 t => Lens' (t a) (V4 a)

ex :: R1 t => E t

ey :: R2 t => E t

ez :: R3 t => E t

ew :: R4 t => E t