Jim Wilson writes:
>
>Norman Vine <[EMAIL PROTECTED]> said:
>
>> Perhaps tie'ing  it to the current waypoint makes sense ...... hmmm
>> 
>
>Yes, but I'd probably want to wait until I was within a few 
>kilometers of the "current" waypoint before switching.

or perhaps when the 'current waypoint' is closer then the
the 'current tower location'

>That would do the trick. We'd need that anyway if we wanted to do an
>approximate model of a GPS some day.

I don't understand what you mean by model a GPS
Are you are using 'GPS' to mean a 'muti-function' GPS receiver ?

If so most of the pieces are already in place.
still need a 'cross-track error' though

< untested pseudo code, off the top of my head >
using normallized geocentic representation 
   i.e.  direction cosine form using geocentric latitude

  sgdSubVec3( dir, track_start, track_end )
     // simgear function
  sgdClosestPointToLine( closest_pt, current_pt, track_start, dir )
     // can probably skip this next step for 'short enough' tracks
  sgdNormalizeVec3(closest_pt) 
  sgdScaleVec3(closest_pt,sea_level_radius)
  sgdScaleVec3(current_pt, sea_level_radius)
  sgdSubVec3(error_vec, closest_pt, current_pt)
    // this should be close enough for our purposes
  crosstrack_error_dist = sgdScalarProductVec3(error_vec)

Norman


_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to