简体   繁体   中英

Converting longitude latitude degrees to miles in Java

How do you convert degrees (longitude latitude) to miles in Java?

For example if I want to move longitude by 69.11 miles, I add 1 degree. Do I do simple calculation or should I use some kind of API.

From http://www.meridianworlddata.com/Distance-Calculation.asp :

Improved approximate distance in miles:

    sqrt(x * x + y * y)

where x = 69.1 * (lat2 - lat1)
and y = 69.1 * (lon2 - lon1) * cos(lat1/57.3) 

There were a few other good sites on the google.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM