Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- double lat1=50.322852;
- double lon1=3.513506;
- double lat2=50.322894;
- double lon2=3.513701;
- double e=(3.14159265358979*lat1/180);
- double f=(3.14159265358979*lon1/180);
- double g=(3.14159265358979*lat2/180);
- double h=(3.14159265358979*lon2/180);
- 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));
- double jj=(Math.acos(ii));
- double k=6371*jj;
- System.out.println("km:"+k+" m:"+k*1000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement