PHP Classes

Calculate distance between two cordinates on earth: See requested Title

Recommend this page to a friend!
  All requests RSS feed  >  Calculate distance between two cordin...  >  Request new recommendation  >  A request is featured when there is no good recommended package on the site when it is posted. Featured requests  >  No recommendations No recommendations  

Calculate distance between two cordinates on earth

Edit

Picture of William Wallace by William Wallace - 9 years ago (2015-05-18)

See requested Title

This request is clear and relevant.
This request is not clear or is not relevant.

+3

I have two points on earth. What is the distance between them? Obviously it is not sqrt(pow(long1 - long2,2) + pow(lat1 - lat2,2) )

Ask clarification

2 Recommendations

PHP Calculate Distance: Find the distance between points using Haversine

This class can find the distance between two points using the Haversine formula.

It takes the latitude and longitude coordinates of two points and calculates the great-circle distance between two points on the surface of a sphere using the Haversine equation formula.

The distance between the two points is returned in terms of miles.
This recommendation solves the problem.
This recommendation does not solve the problem.

+2

Picture of Anthony Amolochitis by Anthony Amolochitis package author package author Reputation 505 - 9 years ago (2015-05-27) Comment

This class should make it easy for you. It calculates the distance between two points on the earth sphere. The example shows how easy it is to use as well.

I hope this helps.


GPS Coordinates Distance: Calculate distance between geographic coordinates

This is a very simple class that can be used to calculate the distance between two points on the terrestrial globe.

It takes the latitude and longitude coordinates of two points represented in decimal format and calculates the length of a straight line between them.

The distance between the points is returned in miles.
This recommendation solves the problem.
This recommendation does not solve the problem.

0

Picture of Dave Smith by Dave Smith Reputation 7620 - 9 years ago (2015-05-18) Comment

This class will calculate the distance between two points and perform a conversion from miles to whatever unit you are after. If I am reading it correctly, the formula (which is in the class) is for a straight line and does not take into account the curvature of the earth, so it may be off slightly.


Recommend package
: 
: