Student Support Forum > General > > "More complex functions"

 Post Reply: Name: Email Address: Please send email when my message is replied to. Url (optional): Subject: Message: view original message? Attachment (optional): Please answer this: 2+1 =

 Original Message (ID '82182') By Bill Simpson: 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.