This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
Rotate, Scale, Translate and Shear shapes
version 1.0.3
license BSD-3-Clause
native-modules False
elm-version 0.18.0 <= v < 0.19.0
Tag 1.0.3
Committed At 2016-11-14 15:57:00 UTC
elm-lang/core 5.0.0 <= v < 6.0.0 5.1.1

Modules

README

elm-geometric-transformation Build status Build Status

An elm package for performing geometric transformations on points

The following 2D transformations are supported:

  • Identity
  • Rotate
  • Scale
  • Shear
  • Translate

API documentation can be found on elm-packages

Quick Start

To rotate a any shape (list of points) by an angle around the origin:

    rotateShape : Float -> List Point -> List Point
    rotateShape angle points =
        let
            transform =
                rotate Clockwise angle
                    |> apply
        in
            List.map transform points

More complicated transforms can be created by using combine as demonstrated in the working example.

Working Example

This package was used to animate the Elm logo as part of the elm-webpack-seed

Not the droid you are looking for?

The following elm packages have similar functionality: