Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Gaming > Development Programming Algorithms > Re: Algorithm t...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 8 of 8 Topic 588 of 679
Post > Topic >>

Re: Algorithm to find the shortest rotation using degrees?

by "m0rdred" <idlerstyle@[EMAIL PROTECTED] > Oct 27, 2006 at 10:18 PM

> int fn(int start, int end)
> {
>    while ((start - target) > 180) start -= 360;
>    while ((start - target) < -180) start += 360;
>
>    if (start < target) return 1;
>    else if (start > target) return -1;
>    else return 0;
> }

By the way, this baby works like a charm!  Nice job!

Thanks
Scott I
 




 8 Posts in Topic:
Algorithm to find the shortest rotation using degrees?
"m0rdred" <i  2006-10-22 22:27:06 
Re: Algorithm to find the shortest rotation using degrees?
"Jim Langston"   2006-10-22 23:58:02 
Re: Algorithm to find the shortest rotation using degrees?
Tom Plunket <gamedev@[  2006-10-25 18:27:15 
Re: Algorithm to find the shortest rotation using degrees?
"m0rdred" <i  2006-10-27 15:06:46 
Re: Algorithm to find the shortest rotation using degrees?
Tom Plunket <gamedev@[  2006-10-27 17:15:06 
Re: Algorithm to find the shortest rotation using degrees?
"m0rdred" <i  2006-10-27 22:12:01 
Re: Algorithm to find the shortest rotation using degrees?
nathan@[EMAIL PROTECTED]   2006-10-28 05:54:39 
Re: Algorithm to find the shortest rotation using degrees?
"m0rdred" <i  2006-10-27 22:18:54 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 18 19:39:52 CDT 2008.