linear-1.10.1: Linear Algebra

Portabilitynon-portable
Stabilityexperimental
MaintainerEdward Kmett <ekmett@gmail.com>
Safe HaskellTrustworthy

Linear.V3

Description

3-D Vectors

Synopsis

Documentation

data V3 a Source

A 3-dimensional vector

Constructors

V3 !a !a !a 

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

cross product

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

scalar triple product

class R1 t whereSource

A space that has at least 1 basis vector _x.

Methods

_x :: Lens' (t a) aSource

>>> 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 whereSource

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

Methods

_y :: Functor f => (a -> f a) -> t a -> f (t a)Source

>>> V2 1 2 ^._y
2
>>> V2 1 2 & _y .~ 3
V2 1 3
 _y :: Lens' (t a) a

_xy :: Functor f => (V2 a -> f (V2 a)) -> t a -> f (t a)Source

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

Instances

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

class R2 t => R3 t whereSource

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

Methods

_z :: Functor f => (a -> f a) -> t a -> f (t a)Source

 _z :: Lens' (t a) a

_xyz :: Functor f => (V3 a -> f (V3 a)) -> t a -> f (t a)Source

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

Instances

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

ex :: R1 t => E tSource

ey :: R2 t => E tSource

ez :: R3 t => E tSource