--- In [email protected], Jos Timanta Tarigan <jos_t_tari...@...> wrote: > > hi, > im currently having a problem try to calculate this: > directionZ = -cos((angleX+90)*PI_RADIAN);
What is PI_RADIAN? [I'll assume (PI/180).] You could try... directionZ = -cos((angleX+90)/180.*PI); Or more simply... directionZ = sin(angleX/180.*PI); Better still would be to work in radians entirely, though that won't remove all the issues. > most of the time it works but when im in the boundary > of the coordinate, it gives me a little error that im > not expecting if calculated correctly. i notice that > when my angleX is 90, and my directionZ should be 0. Really? The cosine of 180 degrees is -1 on my planet. ;) -- Peter
