I am new to Anylogic and I am trying to calculate the distance between two points with given latitude-longitude values. I want the distance in miles. I have found a method from the Anylogic website that is below
default double getDistance(double startLat,
double startLon,
double endLat,
double endLon)
Calculates distance by route between two specified points. Returns: the distance between two specified points, measured in meters.
However, when I run this for two set of points with lat-long
Point 1:
latitude:41.40174, longitude: -72.0201
Point 2:
latitude:45.332, longitude:-73.2215
this gives me a distance of 4.1098062654025815
meters in anylogic; which is wrong.Could you please help me in giving insights what I might be doing wrong? Thanks