View Single Post
  #16  
Old 08-29-2008, 02:05 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Just use radians for your angle. Degrees is seldom used in programming.

PHP Code:
a = pi * 2 / 2; // 180 degree angle
// Of course, in this case, you can just use pi 
To turn 4 directions:

PHP Code:
a += pi / 2; 
To turn 8 directions:
PHP Code:
a += pi / 4; 
__________________
Reply With Quote