linear-1.20.7: Linear Algebra

Linear.V3

Description

3-D Vectors

Synopsis

Documentation

data V3 a #

A 3-dimensional vector

Constructors

 V3 !a !a !a

Instances

cross :: Num a => V3 a -> V3 a -> V3 a #

cross product

triple :: Num a => V3 a -> V3 a -> V3 a -> a #

scalar triple product

class R1 t where #

A space that has at least 1 basis vector _x.

Methods

_x :: Lens' (t a) a #

>>> V1 2 ^._x
2

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


Instances

 # Methods_x :: Functor f => (a -> f a) -> Identity a -> f (Identity a) # # Methods_x :: Functor f => (a -> f a) -> V1 a -> f (V1 a) # # Methods_x :: Functor f => (a -> f a) -> V2 a -> f (V2 a) # # Methods_x :: Functor f => (a -> f a) -> V3 a -> f (V3 a) # # Methods_x :: Functor f => (a -> f a) -> V4 a -> f (V4 a) # R1 f => R1 (Point f) # Methods_x :: Functor f => (a -> f a) -> Point f a -> f (Point f a) #

class R1 t => R2 t where #

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

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

 # Methods_y :: Functor f => (a -> f a) -> V2 a -> f (V2 a) #_xy :: Functor f => (V2 a -> f (V2 a)) -> V2 a -> f (V2 a) # # Methods_y :: Functor f => (a -> f a) -> V3 a -> f (V3 a) #_xy :: Functor f => (V2 a -> f (V2 a)) -> V3 a -> f (V3 a) # # Methods_y :: Functor f => (a -> f a) -> V4 a -> f (V4 a) #_xy :: Functor f => (V2 a -> f (V2 a)) -> V4 a -> f (V4 a) # R2 f => R2 (Point f) # Methods_y :: Functor f => (a -> f a) -> Point f a -> f (Point f a) #_xy :: Functor f => (V2 a -> f (V2 a)) -> Point f a -> f (Point f a) #

_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)

Methods

_z :: Lens' (t a) a #

>>> V3 1 2 3 ^. _z
3


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

Instances

 # Methods_z :: Functor f => (a -> f a) -> V3 a -> f (V3 a) #_xyz :: Functor f => (V3 a -> f (V3 a)) -> V3 a -> f (V3 a) # # Methods_z :: Functor f => (a -> f a) -> V4 a -> f (V4 a) #_xyz :: Functor f => (V3 a -> f (V3 a)) -> V4 a -> f (V4 a) # R3 f => R3 (Point f) # Methods_z :: Functor f => (a -> f a) -> Point f a -> f (Point f a) #_xyz :: Functor f => (V3 a -> f (V3 a)) -> Point f a -> f (Point f a) #

_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) #

ex :: R1 t => E t #

ey :: R2 t => E t #

ez :: R3 t => E t #