Copyright | (c) 2014 diagrams team (see LICENSE) |
---|---|

License | BSD-style (see LICENSE) |

Maintainer | diagrams-discuss@googlegroups.com |

Safe Haskell | None |

Language | Haskell2010 |

Functions for converting between `Transformation`

s and matricies.

- mkMat :: (HasBasis v, Num n) => Transformation v n -> v (v n)
- mkMatHomo :: Num n => Transformation V3 n -> M44 n
- fromMat22 :: Floating n => M22 n -> V2 n -> T2 n
- fromMat33 :: Floating n => M33 n -> V3 n -> T3 n
- fromMatWithInv :: (Additive v, Distributive v, Foldable v, Num n) => v (v n) -> v (v n) -> v n -> Transformation v n
- mat22 :: Floating n => Iso' (M22 n, V2 n) (T2 n)
- mat33 :: Floating n => Iso' (M33 n, V3 n) (T3 n)

# 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 :: Floating n => M22 n -> V2 n -> T2 n Source #

Make a 2D transformation from a 2x2 transform matrix and a
translation vector. Does not check if the matrix is not invertible
(in which case the `T2`

will be invalid).

fromMat33 :: Floating n => M33 n -> V3 n -> T3 n Source #

Make a 3D transformation from a 3x3 transform matrix and a
translation vector. Does not check if the matrix is not invertible
(in which case the `T3`

will be invalid).

:: (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.