reanimate-1.1.3.0: Animation library based on SVGs.
CopyrightWritten by David Himmelstrup
LicenseUnlicense
Maintainerlemmih@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Reanimate.Morph.Rotational

Description

 
Synopsis

Documentation

type Origin = (Double, Double) Source #

Rotational origin relative to polygon center. (0.5, 0.5) is center of polygon. Top right is (1,1) and bottom left is (0,0)

rotationalTrajectory :: Origin -> Trajectory Source #

Interpolation by rotating around an origin point.

Example:

playThenReverseA $ pauseAround 0.5 0.5 $ mkAnimation 3 $ \t ->
  withStrokeLineJoin JoinRound $
  let src = scale 8 $ center $ latex "X"
      dst = scale 8 $ center $ latex "H"
  in morph linear{morphTrajectory=rotationalTrajectory (0.5,0.5)} src dst t

polygonOrigin :: Polygon -> Origin -> V2 Double Source #

Compute the absolute position of rotational origin point in polygon.