linear- Linear Algebra

Safe HaskellNone




(!*!) :: (Functor m, Foldable r, Applicative r, Distributive n, Num a) => m (r a) -> r (n a) -> m (n a)Source

matrix product

(!*) :: (Functor m, Metric r, Num a) => m (r a) -> r a -> m aSource

matrix * column vector

(*!) :: (Metric r, Distributive n, Num a) => r a -> r (n a) -> n aSource

row vector * matrix

adjoint :: (Functor m, Distributive n, Conjugate a) => m (n a) -> n (m a)Source

hermitian conjugate or conjugate transpose

type M33 a = V3 (V3 a)Source

Matrices use a row-major representation.

type M44 a = V4 (V4 a)Source

type M43 a = V4 (V3 a)Source

m33_to_m44 :: Num a => M33 a -> M44 aSource

m43_to_m44 :: Num a => M43 a -> M44 aSource

eye3 :: Num a => M33 aSource

3x3 identity matrix.

eye4 :: Num a => M44 aSource

4x4 identity matrix.

trace :: (Monad f, Foldable f, Num a) => f (f a) -> aSource

Compute the trace of a matrix

translation :: (R3 t, R4 v, Functor f, Functor t) => (V3 a -> f (V3 a)) -> t (v a) -> f (t a)Source

Extract the translation vector (first three entries of the last column) from a 3x4 or 4x4 matrix

fromQuaternion :: Num a => Quaternion a -> M33 aSource

Build a rotation matrix from a Quaternion.

mkTransformation :: Num a => Quaternion a -> V3 a -> M44 aSource

Build a transformation matrix from a rotation expressed as a Quaternion and a translation vector.