diagrams-lib-1.3: Embedded domain-specific language for declarative graphics

Copyright(c) 2014 diagrams team (see LICENSE)
LicenseBSD-style (see LICENSE)
Maintainerdiagrams-discuss@googlegroups.com
Safe HaskellNone
LanguageHaskell2010

Diagrams.Transform.Matrix

Description

Functions for converting between Transformations and matricies.

Synopsis

Documentation

mkMat :: (HasBasis v, Num n) => Transformation v n -> v (v n) Source

Build a matrix from a Transformation, ignoring the translation.

mkMatHomo :: Num n => Transformation V3 n -> M44 n Source

Build a 3D transformation matrix in homogeneous coordinates from a 'Transformation V3'.

fromMat22 :: (Epsilon n, Floating n) => M22 n -> V2 n -> Maybe (T2 n) Source

Make a 2D transformation from a 2x2 transform matrix and a translation vector. If the matrix is not invertible, Nothing is returned.

fromMat33 :: (Epsilon n, Floating n) => M33 n -> V3 n -> Maybe (T3 n) Source

Make a 3D transformation from a 3x3 transform matrix and a translation vector. If the matrix is not invertible, Nothing is returned.

fromMatWithInv Source

Arguments

:: (Additive v, Distributive v, Foldable v, Num n) 
=> v (v n)

matrix

-> v (v n)

inverse

-> v n

translation

-> Transformation v n 

Build a transform with a maxtrix along with its inverse.

mat22 :: (Epsilon n, Floating n) => Prism' (M22 n, V2 n) (T2 n) Source

Prism onto a 2D transformation from a 2x2 transform matrix and translation vector.

mat33 :: (Epsilon n, Floating n) => Prism' (M33 n, V3 n) (T3 n) Source

Prism onto a 2D transformation from a 2x2 transform matrix and translation vector.