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

Diagrams.Deform

Synopsis

# Documentation

newtype Deformation v u n #

Deformations are a superset of the affine transformations represented by the Transformation type. In general they are not invertible. 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 n -> Point u n)

Instances

 Semigroup (Deformation v v n) # Methods(<>) :: Deformation v v n -> Deformation v v n -> Deformation v v n #sconcat :: NonEmpty (Deformation v v n) -> Deformation v v n #stimes :: Integral b => b -> Deformation v v n -> Deformation v v n # Monoid (Deformation v v n) # Methodsmempty :: Deformation v v n #mappend :: Deformation v v n -> Deformation v v n -> Deformation v v n #mconcat :: [Deformation v v n] -> Deformation v v n #

class Deformable a b where #

Minimal complete definition

Methods

deform' :: N a -> Deformation (V a) (V b) (N a) -> a -> b #

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) (V b) (N a) -> a -> b #

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

 (Metric v, Metric u, OrderedField n, (~) * r (Located (Trail u n))) => Deformable (Located (Trail v n)) r # Methodsdeform' :: N (Located (Trail v n)) -> Deformation (V (Located (Trail v n))) (V r) (N (Located (Trail v n))) -> Located (Trail v n) -> r #deform :: Deformation (V (Located (Trail v n))) (V r) (N (Located (Trail v n))) -> Located (Trail v n) -> r # (~) * r (Point u n) => Deformable (Point v n) r # Methodsdeform' :: N (Point v n) -> Deformation (V (Point v n)) (V r) (N (Point v n)) -> Point v n -> r #deform :: Deformation (V (Point v n)) (V r) (N (Point v n)) -> Point v n -> r # (Metric v, Metric u, OrderedField n, (~) * r (Path u n)) => Deformable (Path v n) r # Methodsdeform' :: N (Path v n) -> Deformation (V (Path v n)) (V r) (N (Path v n)) -> Path v n -> r #deform :: Deformation (V (Path v n)) (V r) (N (Path v n)) -> Path v n -> r #

asDeformation :: (Additive v, Num n) => Transformation v n -> Deformation v v n #

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