linear-1.0.1: Linear Algebra

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

Linear.V3

Description

3-D Vectors

Synopsis

Documentation

data V3 a Source

A 3-dimensional vector

Constructors

V3 !a !a !a 

Instances

Monad V3 
Functor V3 
Typeable1 V3 
Applicative V3 
Foldable V3 
Traversable V3 
Distributive V3 
Traversable1 V3 
Foldable1 V3 
Apply V3 
Bind V3 
Additive V3 
Metric V3 
Core V3 
R2 V3 
R3 V3 
Eq a => Eq (V3 a) 
Fractional a => Fractional (V3 a) 
Data a => Data (V3 a) 
Num a => Num (V3 a) 
Ord a => Ord (V3 a) 
Read a => Read (V3 a) 
Show a => Show (V3 a) 
Ix a => Ix (V3 a) 
Storable a => Storable (V3 a) 
Epsilon a => Epsilon (V3 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 R2 t whereSource

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

Methods

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

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

_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 

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