We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
PVector rotation (Read 876 times)
PVector rotation
Mar 18th, 2010, 5:41am
 
For simplicity of working with vectors it would be good to have a method of vector-rotation. Of course, one can always do the maths onself, but the whole idea of PVector is to simply things, right?
Suggestion

PVector.set(/get)angle(rho,phi) which sets(/gets) the angle of the vector with respect to the x-axis in the XY plane and with respect to the XY-plane regardless of the length of the vector. (The origin of the vector is assumed to be 0/0/0 of course)
Angles should be return 0..TWOPI so that the are not ambiguouse.
Page Index Toggle Pages: 1