linear-1.20.8: Linear Algebra

Copyright (C) 2012-2015 Edward Kmett BSD-style (see the file LICENSE) Edward Kmett experimental non-portable Trustworthy Haskell98

Linear.V4

Description

4-D Vectors

Synopsis

# Documentation

data V4 a Source #

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 where Source #

A space that has at least 1 basis vector _x.

Minimal complete definition

_x

Methods

_x :: Lens' (t a) a Source #

>>> V1 2 ^._x
2

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

Instances
 Source # Instance detailsDefined in Linear.V1 Methods_x :: Functor f => (a -> f a) -> Identity a -> f (Identity a) Source # Source # Instance detailsDefined in Linear.V1 Methods_x :: Functor f => (a -> f a) -> V1 a -> f (V1 a) Source # Source # Instance detailsDefined in Linear.V2 Methods_x :: Functor f => (a -> f a) -> V2 a -> f (V2 a) Source # Source # Instance detailsDefined in Linear.V3 Methods_x :: Functor f => (a -> f a) -> V3 a -> f (V3 a) Source # Source # Instance detailsDefined in Linear.V4 Methods_x :: Functor f => (a -> f a) -> V4 a -> f (V4 a) Source # R1 f => R1 (Point f) Source # Instance detailsDefined in Linear.Affine Methods_x :: Functor f0 => (a -> f0 a) -> Point f a -> f0 (Point f a) Source #

class R1 t => R2 t where Source #

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

Minimal complete definition

_xy

Methods

_y :: Lens' (t a) a Source #

>>> V2 1 2 ^._y
2

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


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

Instances
 Source # Instance detailsDefined in Linear.V2 Methods_y :: Functor f => (a -> f a) -> V2 a -> f (V2 a) Source #_xy :: Functor f => (V2 a -> f (V2 a)) -> V2 a -> f (V2 a) Source # Source # Instance detailsDefined in Linear.V3 Methods_y :: Functor f => (a -> f a) -> V3 a -> f (V3 a) Source #_xy :: Functor f => (V2 a -> f (V2 a)) -> V3 a -> f (V3 a) Source # Source # Instance detailsDefined in Linear.V4 Methods_y :: Functor f => (a -> f a) -> V4 a -> f (V4 a) Source #_xy :: Functor f => (V2 a -> f (V2 a)) -> V4 a -> f (V4 a) Source # R2 f => R2 (Point f) Source # Instance detailsDefined in Linear.Affine Methods_y :: Functor f0 => (a -> f0 a) -> Point f a -> f0 (Point f a) Source #_xy :: Functor f0 => (V2 a -> f0 (V2 a)) -> Point f a -> f0 (Point f a) Source #

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

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


class R2 t => R3 t where Source #

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

Minimal complete definition

Methods

_z :: Lens' (t a) a Source #

>>> V3 1 2 3 ^. _z
3


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

Instances
 Source # Instance detailsDefined in Linear.V3 Methods_z :: Functor f => (a -> f a) -> V3 a -> f (V3 a) Source #_xyz :: Functor f => (V3 a -> f (V3 a)) -> V3 a -> f (V3 a) Source # Source # Instance detailsDefined in Linear.V4 Methods_z :: Functor f => (a -> f a) -> V4 a -> f (V4 a) Source #_xyz :: Functor f => (V3 a -> f (V3 a)) -> V4 a -> f (V4 a) Source # R3 f => R3 (Point f) Source # Instance detailsDefined in Linear.Affine Methods_z :: Functor f0 => (a -> f0 a) -> Point f a -> f0 (Point f a) Source #_xyz :: Functor f0 => (V3 a -> f0 (V3 a)) -> Point f a -> f0 (Point f a) Source #

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

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

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

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

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

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

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

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

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

class R3 t => R4 t where Source #

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

Minimal complete definition

Methods

_w :: Lens' (t a) a Source #

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


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

Instances
 Source # Instance detailsDefined in Linear.V4 Methods_w :: Functor f => (a -> f a) -> V4 a -> f (V4 a) Source #_xyzw :: Functor f => (V4 a -> f (V4 a)) -> V4 a -> f (V4 a) Source # R4 f => R4 (Point f) Source # Instance detailsDefined in Linear.Affine Methods_w :: Functor f0 => (a -> f0 a) -> Point f a -> f0 (Point f a) Source #_xyzw :: Functor f0 => (V4 a -> f0 (V4 a)) -> Point f a -> f0 (Point f a) Source #

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

ex :: R1 t => E t Source #

ey :: R2 t => E t Source #

ez :: R3 t => E t Source #

ew :: R4 t => E t Source #