2

I want to visualize matrix transformations in 2- and 3-space. I've tried finding an existing tool to do this to no avail [1] so now I'm looking for Python libraries so I can do it (almost) myself.

So I'd like to be able to enter a vector or matrix, see it in 2-space or 3-space, enter a transformation vector or matrix, and see the result. For example, enter a 3x3 matrix, see the parallelepiped it represents, enter a rotation matrix, see the rotated parallelepiped.

Bonus points for ability to calculate area/volume, animate, change colours, visualize higher dimensions, wash my socks.

I'm guessing I'm looking for two libraries, one for matrix math and one for drawing them in 2D and 3D.

(I'm also willing to look into scripts for existing FLOSS MATLAB clones, as long as said clone can be easily installed on Windows/Ubuntu.)

[1] See https://math.stackexchange.com/questions/34032/floss-tool-to-visualize-2-and-3-space-matrix-transformations and https://superuser.com/questions/275539/floss-tool-to-visualize-2-and-3-space-matrix-transformations if you know of one :)

Community
  • 1
  • 1
lofidevops
  • 15,528
  • 14
  • 79
  • 119

2 Answers2

2

I don't know about mayavi, but with matplotlib you can definitely plot (almost) whatever you like. With the full power of python language you can define your vectors, matrices etc, multiply them any way you wish, and plot the results.

ev-br
  • 24,968
  • 9
  • 65
  • 78
  • matplotlib doesn't have much in the way of 3D support, which is why I suggested mayavi instead. – talonmies Apr 26 '11 at 14:12
  • it did not have it. right now it well has Axes3D object which, I guess, is enough for the OP's goals. I personally never used mayavi, so I cannot offer any sensible judgement here. It's the OP's call, anyway :-). – ev-br Apr 26 '11 at 14:18
  • thanks to both of you, I stumbled on easyviz/scitools while following up on your answers, and I'm giving that a try – lofidevops Apr 28 '11 at 05:58
0

For reference, if you are looking to do something like plotTransforms in Matlab Example transformation matrix plot in Matlab You could use pytransform3d Example transformation matrix plot in Python