+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Calculating distance between two points, using latitude longitude?

Calculating distance between two points, using latitude longitude?

1 posts, 0 answered
  1. Ranjeet
    Ranjeet avatar
    6 posts
    Registered:
    26 Jun 2015
    09 Jul 2015
    Link to this post

    I am trying to calculate distance between two points using java code, I have written a code but it is not working. I have checked various forums to get the resolution to my query. I have found  java questions and answers specifically posted on this forum and hope I'll get a solution from the member of this community. htpp://findnerd.com/askquestion/java
    Here is code

    final double RADIUS = 6371.01;
    double temp = Math.cos(Math.toRadians(latA))
               * Math.cos(Math.toRadians(latB))
               * Math.cos(Math.toRadians((latB) - (latA)))
               + Math.sin(Math.toRadians(latA))
               * Math.sin(Math.toRadians(latB));
       return temp * RADIUS * Math.PI / 180;​

1 posts, 0 answered