[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
Solved

# Calculating East/West Latitude/Longitude points that are x miles from a given GPS point

Posted on 2011-09-23
Medium Priority
730 Views
Hello Experts,

I have a GPS point:

51.747724,-0.406958

I want to know what the GPS point is exactly 3 miles east and west of this point.

I've use the formulae to work out the northern position (in PHP):

``````\$lat = 51.747724;
\$lng = -0.406958;

\$top_lat = \$lat + \$radius_metres/111111*(cos(10 * pi() / 180));

\$north_lat = \$top_lat;
\$north_lng = \$lng;
``````

East point:
``````\$left_lng = \$lng - \$radius_metres/111111*(cos(10 * pi() / 180));
\$east = array(\$lat,\$left_lng);
``````

West point:
``````\$right_lng = \$lng + \$radius_metres/111111*(cos(10 * pi() / 180));
\$west = array(\$lat,\$right_lng);
``````

However, when I use an as-the-crow-files formula, the point is approximately 1.8 miles away
(and not 3 miles)

What is the best way of working out the east and west points.
The maximum distance between my GPS coordinate and these points will be 20 miles (so not a lot).

Many Thanks!
0
Question by:jagku
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

LVL 111

Expert Comment

ID: 36590494
0

LVL 3

Accepted Solution

nrbreen earned 2000 total points
ID: 36590940

You aren't taking account of the effect of lattitude on the width of a longitudinal degree,

``````\$longitudinal_distance=3*1609.344;

\$lng = -0.406958;
\$latitude_degrees=51.747724;

\$left_lng = \$lng - \$longitudinal_delta_degrees ;
\$east = array(\$lat,\$left_lng);

\$right_lng = \$lng + \$longitudinal_delta_degrees ;
\$west = array(\$lat,\$right_lng);
``````
0

Author Closing Comment

ID: 36597713
Many Thanks!

I have realised that my formulae for north/south might not work either.
If I can't get it working - I'll post another question.
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
This article discusses four methods for overlaying images in a container on a web page
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.
###### Suggested Courses
Course of the Month13 days, 3 hours left to enroll