Determine 180 degree turn using compass

Ken Ray kray at sonsothunder.com
Mon Jan 16 00:00:38 EST 2012


On Jan 15, 2012, at 10:59 PM, Ken Ray wrote:

>> And if the starting point is say 10 and I turn left 170 degrees and now I am at 200 and 10 - 200 is -190 but I have not really turned -190 but only 170 and again this may be incorrect based on when the sample interval was fired.
> 
> Actually -190 *is* 170, if you approach it as "if the number is negative, then subtract abs(it) from 360":
> 
>   if tDegrees < 0 then put (360 - tDegrees) into tDegrees

Whoops! I meant:

    if tDegrees < 0 then put (360 - abs(tDegrees)) into tDegrees

Sorry about that…


Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/	




More information about the use-livecode mailing list