typography-geometry-1.0.0.1: Drawings for printed text documents

Safe HaskellNone
LanguageHaskell98

Graphics.Typography.Geometry

Description

This module contains basic tools for geometric types and functions.

Synopsis

Documentation

data Matrix2 a Source #

The type of the transformation matrices used in all geometrical applications.

Constructors

Matrix2 a a a a

The application of Matrix2 a b c d to vector (x,y) should be (ax+by,cx+dy).

inverse :: (Fractional a, Num a) => Matrix2 a -> Matrix2 a Source #

Inverses an inversible matrix. If it is not inversible, The behaviour is undefined.

rotation :: Floating a => a -> Matrix2 a Source #

The matrix of a rotation

class Geometric g where Source #

A class for applying geometric applications to objects

Minimal complete definition

translate, apply

Methods

translate :: Double -> Double -> g -> g Source #

apply :: Matrix2 Double -> g -> g Source #

Instances

leftMost :: (Double, Double) -> (Double, Double) -> (Double, Double) Source #

leftMost a b is the leftmost point between a and b.

rightMost :: (Double, Double) -> (Double, Double) -> (Double, Double) Source #

rightMost a b is the rightmost point between a and b.

topMost :: (Double, Double) -> (Double, Double) -> (Double, Double) Source #

topMost a b is the upper point between a and b.

bottomMost :: (Double, Double) -> (Double, Double) -> (Double, Double) Source #

bottomMost a b is the lower point between a and b.