Hello,

After many tests and hours lost, and many searches in google, I’m ashamed to say I do not find how to convert from the convention of spherical coordinates in dynamic plugins (with VMath.Polar) and the one of vvvv (Polar node).

Could someone tell me how to do, and which is the exact convention of spherical coordinates in vvvv ?

Thank you,

Matthieu

joreg
May 13, 2011, 11:43am
#2
helo matthieu,

please check VMath.CartesianVVVV which is clearly missing its counterpart VMath.PolarVVVV.

in the meantime you should be able to convert the result of VMath.Polar (which is in radians) to vvvv cycles by multiplying with VMath.RadToCyc .

vux
May 13, 2011, 12:23pm
#3
Hello,

needed that at some point, as far as i remember formula was looking like this (c++ code here, result in cycles, same as vvvv):

double length = sqrt(xx,y y,z*z);
double pitch = asin(y/mod)/TWOPI;
double yaw = x > 0 ? (atan2(x,z) - PI) / TWOPI : (atan2(x,z) + PI) / TWOPI;

for results in radians just remove the / TWOPI in pitch and yaw.

Not sure the node uses the same formula, but on all my tests had the same result, if you find a set of values where result is different let me know.

Thank you very much.
I will try.

sounds like a little job for me, will add it for the next relese!

Thank you ! It will be useful !

done… if you are interested in the code, look here at line 1021.