Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^3: Polar Co-Ordinates: Rotating a 3D cartesian point around a fixed axis?

by salva (Monsignor)
on Jun 28, 2012 at 20:56 UTC ( #978998=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Polar Co-Ordinates: Rotating a 3D cartesian point around a fixed axis?
in thread Polar Co-Ordinates: Rotating a 3D cartesian point around a fixed axis?

The line is defined by two vectors:

The first vector defines the direction of the line; it corresponds to $axis on the code from my previous post.

The second vector indicates the positions of some point of the line relative to the origin (it can be any point on the line). It is what I have called $offset.

The rotate_3d performs the rotation around a line passing through the origin and with the given direction, so to use it to rotate a vector $p around a line that does not pass through the origin, we have to perform a translation, rotate the vector and undo the translation.

In practice, that means, subtracting the vector $offset to $p, performing the rotation, and then adding $offset to the resulting value.


Comment on Re^3: Polar Co-Ordinates: Rotating a 3D cartesian point around a fixed axis?
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://978998]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (13)
As of 2014-07-25 19:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (174 votes), past polls