Maintainer | diagrams-discuss@googlegroups.com |
---|
Transformations specific to two dimensions, with a few generic transformations (uniform scaling, translation) also re-exported for convenience.
- rotation :: Angle -> Transformation R2
- rotate :: (Transformable t, V t ~ R2) => Angle -> t -> t
- rotationBy :: Double -> Transformation R2
- rotateBy :: (Transformable t, V t ~ R2) => Angle -> t -> t
- scalingX :: Double -> Transformation R2
- scaleX :: (Transformable t, V t ~ R2) => Double -> t -> t
- scalingY :: Double -> Transformation R2
- scaleY :: (Transformable t, V t ~ R2) => Double -> t -> t
- scaling :: (HasLinearMap v, Fractional (Scalar v)) => Scalar v -> Transformation v
- scale :: (Transformable t, Fractional (Scalar (V t))) => Scalar (V t) -> t -> t
- translationX :: Double -> Transformation R2
- translateX :: (Transformable t, V t ~ R2) => Double -> t -> t
- translationY :: Double -> Transformation R2
- translateY :: (Transformable t, V t ~ R2) => Double -> t -> t
- translation :: HasLinearMap v => v -> Transformation v
- translate :: (Transformable t, HasLinearMap (V t)) => V t -> t -> t
- reflectionX :: Transformation R2
- reflectX :: (Transformable t, V t ~ R2) => t -> t
- reflectionY :: Transformation R2
- reflectY :: (Transformable t, V t ~ R2) => t -> t
Rotation
rotation :: Angle -> Transformation R2Source
Create a transformation which performs a rotation by the given angle in radians.
rotationBy :: Double -> Transformation R2Source
Create a transformation which performs a rotation by the given
fraction of a circle. For example, rotationBy (1/4)
rotates by
one quarter of a circle (i.e. 90 degrees, i.e. pi/2 radians).
rotateBy :: (Transformable t, V t ~ R2) => Angle -> t -> tSource
Rotate by the given fraction of a circle.
Scaling
scalingX :: Double -> Transformation R2Source
Construct a transformation which scales by the given factor in the x (horizontal) direction.
scaleX :: (Transformable t, V t ~ R2) => Double -> t -> tSource
Scale a diagram by the given factor in the x (horizontal)
direction. To scale uniformly, use
Graphics.Rendering.Diagrams.Transform.scale
.
scalingY :: Double -> Transformation R2Source
Construct a transformation which scales by the given factor in the y (vertical) direction.
scaleY :: (Transformable t, V t ~ R2) => Double -> t -> tSource
Scale a diagram by the given factor in the y (vertical)
direction. To scale uniformly, use
Graphics.Rendering.Diagrams.Transform.scale
.
scaling :: (HasLinearMap v, Fractional (Scalar v)) => Scalar v -> Transformation v
Create a uniform scaling transformation.
scale :: (Transformable t, Fractional (Scalar (V t))) => Scalar (V t) -> t -> t
Scale uniformly in every dimension by the given scalar.
Translation
translationX :: Double -> Transformation R2Source
Construct a transformation which translates by the given distance in the x (horizontal) direction.
translateX :: (Transformable t, V t ~ R2) => Double -> t -> tSource
Translate a diagram by the given distance in the x (horizontal) direction.
translationY :: Double -> Transformation R2Source
Construct a transformation which translates by the given distance in the y (vertical) direction.
translateY :: (Transformable t, V t ~ R2) => Double -> t -> tSource
Translate a diagram by the given distance in the y (vertical) direction.
translation :: HasLinearMap v => v -> Transformation v
Create a translation.
translate :: (Transformable t, HasLinearMap (V t)) => V t -> t -> t
Translate by a vector.
Reflection
reflectionX :: Transformation R2Source
Construct a transformation which flips a diagram from left to right, i.e. sends the point (x,y) to (-x,y).
reflectX :: (Transformable t, V t ~ R2) => t -> tSource
Flip a diagram from left to right, i.e. send the point (x,y) to (-x,y).
reflectionY :: Transformation R2Source
Construct a transformation which flips a diagram from top to bottom, i.e. sends the point (x,y) to (x,-y).
reflectY :: (Transformable t, V t ~ R2) => t -> tSource
Flip a diagram from top to bottom, i.e. send the point (x,y) to (x,-y).