Friday, 9 August 2013

Slicing Up Uniform Random Rotation Quaternions

Slicing Up Uniform Random Rotation Quaternions

I'm generating uniform random rotations using quaternions. I am using the
method attributed to Shoemake, which is discussed in another post (Uniform
Random Quaternion In a restricted angle range):
s = rand(1.0)
è1 = 2ð ∗ rand(1.0)
è2 = 2ð ∗ rand(1.0)
w = cos(è2) ∗ sqrt(s)
x = sin(è1) ∗ sqrt(1 − s)
y = cos(è1) ∗ sqrt(1 − s)
z = sin(è2) ∗ sqrt(s)
I want so slice up the space into a half, a third, a quarter etc in each
of the three degrees of freedom by restricting the random number ranges of
s, è1 and è2 but retain the uniform density. I have tried:
s/=divisor1
è1/=divisor2
è2/=divisor3
This seems to work for s, but not the two angles. Can anyone suggest how
this might be done?

No comments:

Post a Comment