SHARE
TWEET

Untitled

a guest Feb 19th, 2019 86 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. double lat1=50.322852;
  2.         double lon1=3.513506;
  3.         double lat2=50.322894;
  4.         double lon2=3.513701;
  5.  
  6.        
  7.         double e=(3.14159265358979*lat1/180);
  8.         double f=(3.14159265358979*lon1/180);
  9.         double g=(3.14159265358979*lat2/180);
  10.         double h=(3.14159265358979*lon2/180);
  11.         double ii=(Math.cos(e)*Math.cos(g)*Math.cos(f)*Math.cos(h)+Math.cos(e)*Math.sin(f)*Math.cos(g)*Math.sin(h)+Math.sin(e)*Math.sin(g));
  12.         double jj=(Math.acos(ii));
  13.         double k=6371*jj;
  14.        
  15.         System.out.println("km:"+k+" m:"+k*1000);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top