Distance between two longitude and latitude

Source: Internet
Author: User
// The distance between two longitude and latitude ranges from private final double earth_radius = 6378137.0; private double gps2m (double lat_a, double lng_a, double lat_ B, double lng_ B) {double radlat1 = (lat_a * Math. (PI/180.0); double radlat2 = (lat_ B * Math. PI/180.0); Double A = radlat1-radlat2; Double B = (lng_a-lng_ B) * Math. PI/180.0; double S = 2 * Math. asin (math. SQRT (math. pow (math. sin (A/2), 2) + math. cos (radlat1) * Math. cos (radlat2) * Math. pow (math. sin (B/2), 2); s = S * earth_radius; S = math. round (S * 10000)/10000; return s ;}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.