0

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.

mpso
  • 1,129
  • 2
  • 13
  • 26

3 Answers3

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 :)

Community
  • 1
  • 1
woofmeow
  • 2,370
  • 16
  • 13
1

Google Closure library has AffineTransform.js. If you don't want to include the whole closure library, I made a standalone version:

https://github.com/TheRoccoB/standalone-closure-graphics

RoccoB
  • 2,439
  • 2
  • 27
  • 30
0

You could try text manipulation lib textillate.js jschr.github.io/textillate

Ken Penn
  • 756
  • 6
  • 6