| Author |
Comment/Response |
Bill Simpson
|
10/25/12 1:46pm
Suppose you can turn your three rotations into a single rotationMatrix, that seems conventional.
Suppose you add a translationVector, rather than multiplying by a translation, that seems conventional.
Then this function seems like it will do what you want.
rotateAndTranslate[listOfPoints_] :=
Map[rotationMatrix.# + translationVector &, listOfPoints]
Map[someFunction,someList] will do someFunction to each member of someList and return a list off all those results. # and & is a cryptic sometimes confusing notation often used for this. The # is the point being operated on and the & indicates to Mathematica that all this is a function.
That tiny little almost invisible "." between rotationMatrix and # is multiplying your matrix times your point.
Try this first on some REALLY simple hand crafted data and rotation matrix. Verify it works on a few points. Try slightly a more complicated rotation matrix and verify that it still works. Verify that a translation vector of {0,0,0} doesn't translate at all. etc, etc, etc.
URL: , |
|