nonlinear-0.1.0: Low-dimensional vectors
Safe HaskellNone
LanguageHaskell2010

Nonlinear.Projective.Hom2

Description

Functions for working with 2-dimensional homogeneous coordinates.

Synopsis

Documentation

vector :: Num a => V2 a -> V3 a Source #

Convert a 2-dimensional affine vector into a 3-dimensional homogeneous vector, i.e. sets the w coordinate to 0.

point :: Num a => V2 a -> V3 a Source #

Convert a 2-dimensional affine point into a 3-dimensional homogeneous vector, i.e. sets the w coordinate to 1.

normalizePoint :: Fractional a => V3 a -> V2 a Source #

Convert 3-dimensional projective coordinates to a 2-dimensional point. This operation may be denoted, euclidean [x:y:w] = (x/w, y/w) where the projective, homogeneous, coordinate [x:y:z] is one of many associated with a single point (x/w, y/w).

mkTransformation :: Num a => M22 a -> V2 a -> M33 a Source #

translation :: Num a => V2 a -> M33 a Source #

translate along two axes

rotateRad :: Floating a => a -> M33 a Source #

rotate a radiant angle

m22_to_m33 :: Num a => M22 a -> M33 a Source #

Convert a 2x2 matrix to a 3x3 matrix extending it with 0's in the new row and column.