Created
August 15, 2017 12:31
-
-
Save rezoner/aa0bc8f87f0b60df13ed92d930b0ae49 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
translation: function(tx, ty) { | |
return [ | |
1, 0, 0, | |
0, 1, 0, | |
tx, ty, 1, | |
]; | |
}, | |
rotation: function(angleInRadians) { | |
var c = Math.cos(angleInRadians); | |
var s = Math.sin(angleInRadians); | |
return [ | |
c, -s, 0, | |
s, c, 0, | |
0, 0, 1, | |
]; | |
}, | |
scaling: function(sx, sy) { | |
return [ | |
sx, 0, 0, | |
0, sy, 0, | |
0, 0, 1, | |
]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment