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

Safe HaskellNone

Diagrams.Deform

Synopsis

Documentation

data Deformation v Source

Deformations are a superset of the affine transformations represented by the Transformation type. In general they are not invertable. Deformations include projective transformations. Deformation can represent other functions from points to points which are well-behaved, in that they do not introduce small wiggles.

Constructors

Deformation (Point v -> Point v) 

class Deformable a whereSource

Methods

deform' :: Scalar (V a) -> Deformation (V a) -> a -> aSource

deform' epsilon d a transforms a by the deformation d. If the type of a is not closed under projection, approximate to accuracy epsilon.

deform :: Deformation (V a) -> a -> aSource

deform d a transforms a by the deformation d. If the type of a is not closed under projection, deform should call deform' with some reasonable default value of epsilon.

Instances

Deformable (Point v) 
(VectorSpace v, InnerSpace v, ~ * s (Scalar v), Ord s, Fractional s, Floating s, Show s, Show v) => Deformable (Located (Trail v)) 
(VectorSpace v, InnerSpace v, ~ * s (Scalar v), Ord s, Fractional s, Floating s, Show s, Show v) => Deformable (Path v) 

asDeformation :: (HasTrie (Basis v), HasBasis v) => Transformation v -> Deformation vSource

asDeformation converts a Transformation to a Deformation by discarding the inverse transform. This allows reusing Transformations in the construction of Deformations.