You can do this using Great Circle algorithms.

Here's how to find distance. You would need to solve the equation for lat2.

distance = ((factor * (lat2-lat1)) ^ 2 + (factor * (lng2 - lng1) * cos(lat2 / 
57.3)) ^ 2) ^ .5

Note: factor ~ 69.1 for miles ~ 115.1666667 for km

Jeremy R. Geerdes
Generally Cool Guy
Des Moines, IA

For more information or a project quote:
jrgeer...@gmail.com

If you're in the Des Moines, IA, area, check out Debra Heights Wesleyan Church!

On Mar 5, 2012, at 7:10 AM, khaldoon wrote:

> Hi,
> Is there any way to add 5km distance to latitude, in order to move geographic 
> point to 5 km north or add 5 km to longitude to move 5km east. I want to get 
> the new lat and  lng after adding distance value.
> Example:
> lat1: 34
> lng1: 34
> after adding 5km in lat1, new point should be like
> new_lat1: 34+5km
> new_lng1: 34 (lng1 will remain same as we only added in latitude)
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Google Maps JavaScript API v3" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/google-maps-js-api-v3/-/cB7fUaZ2GEgJ.
> To post to this group, send email to google-maps-js-api-v3@googlegroups.com.
> To unsubscribe from this group, send email to 
> google-maps-js-api-v3+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/google-maps-js-api-v3?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" group.
To post to this group, send email to google-maps-js-api-v3@googlegroups.com.
To unsubscribe from this group, send email to 
google-maps-js-api-v3+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-maps-js-api-v3?hl=en.

Reply via email to