hgeometry-0.9.0.0: Geometric Algorithms, Data structures, and Data types.

Data.Geometry.Transformation

Synopsis

# Matrices

newtype Matrix n m r Source #

a matrix of n rows, each of m columns, storing values of type r

Constructors

 Matrix (Vector n (Vector m r))
Instances
 (Arity n, Arity m) => Functor (Matrix n m) Source # Instance detailsDefined in Data.Geometry.Transformation Methodsfmap :: (a -> b) -> Matrix n m a -> Matrix n m b #(<$) :: a -> Matrix n m b -> Matrix n m a # (Eq r, Arity n, Arity m) => Eq (Matrix n m r) Source # Instance detailsDefined in Data.Geometry.Transformation Methods(==) :: Matrix n m r -> Matrix n m r -> Bool #(/=) :: Matrix n m r -> Matrix n m r -> Bool # (Ord r, Arity n, Arity m) => Ord (Matrix n m r) Source # Instance detailsDefined in Data.Geometry.Transformation Methodscompare :: Matrix n m r -> Matrix n m r -> Ordering #(<) :: Matrix n m r -> Matrix n m r -> Bool #(<=) :: Matrix n m r -> Matrix n m r -> Bool #(>) :: Matrix n m r -> Matrix n m r -> Bool #(>=) :: Matrix n m r -> Matrix n m r -> Bool #max :: Matrix n m r -> Matrix n m r -> Matrix n m r #min :: Matrix n m r -> Matrix n m r -> Matrix n m r # (Show r, Arity n, Arity m) => Show (Matrix n m r) Source # Instance detailsDefined in Data.Geometry.Transformation MethodsshowsPrec :: Int -> Matrix n m r -> ShowS #show :: Matrix n m r -> String #showList :: [Matrix n m r] -> ShowS # multM :: (Arity r, Arity c, Arity c', Num a) => Matrix r c a -> Matrix c c' a -> Matrix r c' a Source # mult :: (Arity m, Arity n, Num r) => Matrix n m r -> Vector m r -> Vector n r Source # class Invertible n r where Source # Methods inverse' :: Matrix n n r -> Matrix n n r Source # Instances  Fractional r => Invertible 2 r Source # Instance detailsDefined in Data.Geometry.Transformation Methodsinverse' :: Matrix 2 2 r -> Matrix 2 2 r Source # Fractional r => Invertible 3 r Source # Instance detailsDefined in Data.Geometry.Transformation Methodsinverse' :: Matrix 3 3 r -> Matrix 3 3 r Source # Fractional r => Invertible 4 r Source # Instance detailsDefined in Data.Geometry.Transformation Methodsinverse' :: Matrix 4 4 r -> Matrix 4 4 r Source # # Transformations newtype Transformation d r Source # A type representing a Transformation for d dimensional objects Constructors  Transformation Fields_transformationMatrix :: Matrix (d + 1) (d + 1) r Instances  Arity (d + 1) => Functor (Transformation d) Source # Instance detailsDefined in Data.Geometry.Transformation Methodsfmap :: (a -> b) -> Transformation d a -> Transformation d b #(<$) :: a -> Transformation d b -> Transformation d a # (Eq r, Arity (d + 1)) => Eq (Transformation d r) Source # Instance detailsDefined in Data.Geometry.Transformation Methods(==) :: Transformation d r -> Transformation d r -> Bool #(/=) :: Transformation d r -> Transformation d r -> Bool # (Ord r, Arity (d + 1)) => Ord (Transformation d r) Source # Instance detailsDefined in Data.Geometry.Transformation Methodscompare :: Transformation d r -> Transformation d r -> Ordering #(<) :: Transformation d r -> Transformation d r -> Bool #(<=) :: Transformation d r -> Transformation d r -> Bool #(>) :: Transformation d r -> Transformation d r -> Bool #(>=) :: Transformation d r -> Transformation d r -> Bool #max :: Transformation d r -> Transformation d r -> Transformation d r #min :: Transformation d r -> Transformation d r -> Transformation d r # (Show r, Arity (d + 1)) => Show (Transformation d r) Source # Instance detailsDefined in Data.Geometry.Transformation MethodsshowsPrec :: Int -> Transformation d r -> ShowS #show :: Transformation d r -> String #showList :: [Transformation d r] -> ShowS # type NumType (Transformation d r) Source # Instance detailsDefined in Data.Geometry.Transformation type NumType (Transformation d r) = r

transformationMatrix :: Lens' (Transformation d r) (Matrix (d + 1) (d + 1) r) Source #

(|.|) :: (Num r, Arity (d + 1)) => Transformation d r -> Transformation d r -> Transformation d r Source #

Compose transformations (right to left)

inverseOf :: (Fractional r, Invertible (d + 1) r) => Transformation d r -> Transformation d r Source #

Compute the inverse transformation

# 3D Rotations

rotateTo :: Num r => Vector 3 (Vector 3 r) -> Transformation 3 r Source #

Given three new unit-length basis vectors (u,v,w) that map to (x,y,z), construct the appropriate rotation that does this.