more useful options | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
The whole problem becomes far simpler if you re-base your points (both those you need to rotate, and those that form stopping points) so that they are relative to your axis of rotation. Ie. move the entire field of view so that the axis unit vector lines up with the Z-axis of your re-based coordinate system. You can then subset your stopping points against your input points by their radius. That is, once the points are re-based, sqrt( x2 + y2 ) for each of the points will give you their radius of rotation. Now you only need compare any given input point against those stopping points that have that same radius (+-some tolorance). And if once you've re-based the points, you convert them to 2D vectors, the length is the radius directly, and the difference between their angles tells you how far you would have to rotate them before they collided. So now you don't need to rotate all the points incrementally at all, you simply find all the pairs of input/stopping points that can collide; and choose the minimum or maximum angle (depending upon which direction you are rotating them, as your "first collision point". This is a much simpler, and far more computationally efficient way of folding your molecule. With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
In reply to Re^5: Polar Co-Ordinates: Rotating a 3D cartesian point around a fixed axis?
by BrowserUk
|
|