P is for Practical  
PerlMonks 
Re^2: computational efficiencyby thelycaeum (Initiate) 
on Oct 10, 2011 at 19:00 UTC ( #930693=note: print w/ replies, xml )  Need Help?? 
I've read the article a couple of times by now. Let me comment on that. I've been planning to randomize my rotation subroutine by doing three subsequent arbitrary rotations about each axis in cartesian space, i.e. arbitrary rotation with independent randomization for each axis x, y and z. These however have to be randomized by two randomization processes each, as the sign of the cosine corresponding to the randomized sine has to randomized, too (if I'm not mistaken here, cf. my reply to moritz comment on correctness). Hence, my (thanks to your comments) improved idea would involve six randomizations for each arbitrary rotation, while the method posted on wolfram would involve only two (cf. equations 9 to 11 in the article), correct? What I'm asking myself right now is the following: Moritz is absolutely correct, as a single rotation about one axis (which was my original question) results in omitting half of the angles, consequently incompleteness and bias towards rotation angles below 180°. Would this still be true, if the routine is applied about each axis xyz? So, if Marsaglia (1972) uses two randomizations to produce an arbitrary point in three dimensional space in the polar coordinate system, would three randomizations in cartesian space still result in incompleteness? I think so, because equations 13 to 15 imply, that at least four randomizations are needed in cartesian space... ? P.S.: MidLifeXis: Thank you, I found use Benchmark qw(:all) ;on http://perldoc.perl.org/Benchmark.html
In Section
Seekers of Perl Wisdom

