Skip to content

calculate distance with one known point#4

Open
tedder wants to merge 1 commit into
codegardenllc:masterfrom
tedder:patch-1
Open

calculate distance with one known point#4
tedder wants to merge 1 commit into
codegardenllc:masterfrom
tedder:patch-1

Conversation

@tedder

@tedder tedder commented Apr 12, 2016

Copy link
Copy Markdown

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)

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant