My question is related to a Basic4PPC project but is really about geometry.
I am extending GPS4PPC to have much of the functionality of my ancient (and deteriorating) Garmin GPS-II+. Including having a "route" of several "legs" to navigate in succession. The screen-shot shows an example, taken from a holiday to Croatia in 2005. (The data can be exchanged via GPX or KML files.)
The Garmin manual says that the leg being navigated is chosen as the nearest one from the full set in the route. This should result in navigating them in the right order but not having to sail exactly to each waypoint that marks the join of leg to leg.
So the geometry puzzle is how to measure the distance to a line. Not to the infinite line defined by two points but the finite line between those points. Anyone know, or how to find, the algorithm?
TIA, Mike.
I am extending GPS4PPC to have much of the functionality of my ancient (and deteriorating) Garmin GPS-II+. Including having a "route" of several "legs" to navigate in succession. The screen-shot shows an example, taken from a holiday to Croatia in 2005. (The data can be exchanged via GPX or KML files.)
The Garmin manual says that the leg being navigated is chosen as the nearest one from the full set in the route. This should result in navigating them in the right order but not having to sail exactly to each waypoint that marks the join of leg to leg.
So the geometry puzzle is how to measure the distance to a line. Not to the infinite line defined by two points but the finite line between those points. Anyone know, or how to find, the algorithm?
TIA, Mike.