A library for basic 2D affine transformations
A small JS Library for doing affine transformations and (coming soon) other simple transformations
I need for a bigger project.
polygon are currently the two exports.
For your convenience, this project is stitched into one JS file,
affine.js. The stitched file provides a way of requiring components. Here's an in-browser example:
npm install -g affine
require 'affine'rot_left = MathPI / 4rot_right = -MathPI / 4go_big = 24go_small = 0.50.25# rightComposing a transform A with another, A'# desctructively replaces A with A'(A)t = rot_leftcopytrightComposeWith rot_righttrightComposeWith go_bigtrightComposeWith go_smallsquare = polygonfactoryunitSquaresquaretransform t# square should be the same, as the 4 affines# cancel each other out.consolelog square
.json files are auto-generated. Please edit the appropropriate
.coffee files and run
cake build before committing.