Loading ...
Sorry, an error occurred while loading the content.

Re: [tracker2] Distance calculation redux

Expand Messages
  • James Ewen
    ... A nasty hack would be to use a lookup table which would convert the tangent value to degrees. That s basically what I did to get the 16 compass bearings. I
    Message 1 of 8 , Aug 31, 2006
    • 0 Attachment
      >I want to get the bearing calculated down to at least a couple
      >of degrees, since it'll potentially be used for automatic antenna
      >aiming (e.g., tracking an ATV-equipped plane.)
       
      A nasty hack would be to use a lookup table which would convert the tangent value to degrees. That's basically what I did to get the 16 compass bearings. I just ran through a few if-then statements to check if the value was within the limits of each section. Because the values follow a pattern I was able to fold the 360 degree circle into 90 degree sections. You could do the same, and only have to check through 90 values and subtract the appropriate amount from a preset value depending on the quadrant you are working in. It's not elegant, but it can get the job done when you have limited tools and resources.
       
      James
      VE6SRV


      I am using the free version of SPAMfighter for private users.
      It has removed 152 spam emails to date.
      Paying users do not have this message in their emails.
      Try SPAMfighter for free now!
    Your message has been successfully submitted and would be delivered to recipients shortly.