| Copyright | (C) 2012-2015 Edward Kmett |
|---|---|
| License | BSD-style (see the file LICENSE) |
| Maintainer | Edward Kmett <ekmett@gmail.com> |
| Stability | experimental |
| Portability | non-portable |
| Safe Haskell | Trustworthy |
| Language | Haskell2010 |
Linear.V4
Description
4-D Vectors
Synopsis
- data V4 a = V4 !a !a !a !a
- vector :: Num a => V3 a -> V4 a
- point :: Num a => V3 a -> V4 a
- normalizePoint :: Fractional a => V4 a -> V3 a
- class R1 (t :: Type -> Type) where
- class R1 t => R2 (t :: Type -> Type) where
- _yx :: forall (t :: Type -> Type) a. R2 t => Lens' (t a) (V2 a)
- class R2 t => R3 (t :: Type -> Type) where
- _xz :: forall (t :: Type -> Type) a. R3 t => Lens' (t a) (V2 a)
- _yz :: forall (t :: Type -> Type) a. R3 t => Lens' (t a) (V2 a)
- _zx :: forall (t :: Type -> Type) a. R3 t => Lens' (t a) (V2 a)
- _zy :: forall (t :: Type -> Type) a. R3 t => Lens' (t a) (V2 a)
- _xzy :: forall (t :: Type -> Type) a. R3 t => Lens' (t a) (V3 a)
- _yxz :: forall (t :: Type -> Type) a. R3 t => Lens' (t a) (V3 a)
- _yzx :: forall (t :: Type -> Type) a. R3 t => Lens' (t a) (V3 a)
- _zxy :: forall (t :: Type -> Type) a. R3 t => Lens' (t a) (V3 a)
- _zyx :: forall (t :: Type -> Type) a. R3 t => Lens' (t a) (V3 a)
- class R3 t => R4 (t :: Type -> Type) where
- _xw :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V2 a)
- _yw :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V2 a)
- _zw :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V2 a)
- _wx :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V2 a)
- _wy :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V2 a)
- _wz :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V2 a)
- _xyw :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V3 a)
- _xzw :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V3 a)
- _xwy :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V3 a)
- _xwz :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V3 a)
- _yxw :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V3 a)
- _yzw :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V3 a)
- _ywx :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V3 a)
- _ywz :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V3 a)
- _zxw :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V3 a)
- _zyw :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V3 a)
- _zwx :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V3 a)
- _zwy :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V3 a)
- _wxy :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V3 a)
- _wxz :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V3 a)
- _wyx :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V3 a)
- _wyz :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V3 a)
- _wzx :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V3 a)
- _wzy :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V3 a)
- _xywz :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V4 a)
- _xzyw :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V4 a)
- _xzwy :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V4 a)
- _xwyz :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V4 a)
- _xwzy :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V4 a)
- _yxzw :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V4 a)
- _yxwz :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V4 a)
- _yzxw :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V4 a)
- _yzwx :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V4 a)
- _ywxz :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V4 a)
- _ywzx :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V4 a)
- _zxyw :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V4 a)
- _zxwy :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V4 a)
- _zyxw :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V4 a)
- _zywx :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V4 a)
- _zwxy :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V4 a)
- _zwyx :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V4 a)
- _wxyz :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V4 a)
- _wxzy :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V4 a)
- _wyxz :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V4 a)
- _wyzx :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V4 a)
- _wzxy :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V4 a)
- _wzyx :: forall (t :: Type -> Type) a. R4 t => Lens' (t a) (V4 a)
- ex :: forall (t :: Type -> Type). R1 t => E t
- ey :: forall (t :: Type -> Type). R2 t => E t
- ez :: forall (t :: Type -> Type). R3 t => E t
- ew :: forall (t :: Type -> Type). R4 t => E t
Documentation
A 4-dimensional vector.
Constructors
| V4 !a !a !a !a |
Instances
vector :: Num a => V3 a -> V4 a Source #
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 Source #
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 Source #
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 :: Type -> Type) where Source #
A space that has at least 1 basis vector _x.
class R1 t => R2 (t :: Type -> Type) where Source #
Minimal complete definition
Methods
>>>V2 1 2 ^._y2
>>>V2 1 2 & _y .~ 3V2 1 3