Determine 180 degree turn using compass

Ken Ray kray at sonsothunder.com
Sun Jan 15 23:59:16 EST 2012


> 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

:D

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