Is there a JavaScript library that will allow me to perform some matrix-like transformations (for example, rotating and mirroring) on 2D text arrays? The arrays will contain characters and strings.
Asked
Active
Viewed 1,084 times
0
-
Try https://github.com/toji/gl-matrix – Srikanth AD Aug 12 '13 at 19:04
-
Check the libraries below. – woofmeow Aug 12 '13 at 19:13
-
Have any of these libraries been specifically tested to work with text arrays? Thanks for the information. – mpso Aug 19 '13 at 15:10
3 Answers
1
Have a look at math.js. It can do matrix operations.
Also check out Sylvester this I think might be easier to work with. It can even handle three dimensional space.
Here is a small example from it
var V1 = $V([3,4,5]); var V2 = $V([9,-3,0]); var d = V1.dot(V2); // d is 15 var c = V1.cross(V2); // c is the vector (15,45,-45)
There is also webgl-mjs optimized for WebGL usage.
Also look at this answer relating to rotation with your own function.
Hope that helps :)
1
Google Closure library has AffineTransform.js. If you don't want to include the whole closure library, I made a standalone version:

RoccoB
- 2,439
- 2
- 27
- 30