codegardenllc / tiny_gps_plus

TinyGPS++ Library
MIT License
12 stars 19 forks source link

calculate distance with one known point #4

Open tedder opened 8 years ago

tedder commented 8 years ago

First, apologies because I'm not equipped to test this, nor am I sure it's correct, but I hope it's close.

The idea is to create a helper method for gps.location.distanceBetween(). That way the object's location can be used instead of needing to pass it back in:

gps.distanceBetween(otherLat, otherLng, gps.location.lat(), gps.location.lng())

Here's the helper method:

gps.location.distanceBetween(otherLat, otherLng)