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

Safe HaskellNone
LanguageHaskell2010

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 where Source

Methods

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

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 -> a Source

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 v Source

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