Using Arcade Code, I've obtained the coordinates between two points and used Vincenty's Formula to calculate the distance between the two points; however, it's not as accurate as the measure tool in the Web Map.
I was wondering what the correct formula I should use for calculating the distance between two points using their coordinates.(I know it depends on the coordinate system, but I thought WGS 1984 would be Vincenty's Formula.)
I also don't want the Planar Distance... so no Distance(Feature1,Feature2) please.
| Vincenty's |
|---|
function Vincenty(lat1,lon1,lat2,lon2){ var x = PI / 180; var latone = lat1 * x; var lonone = lon1 * x; var lattwo = lat2 * x; var lontwo = lon2 * x; var deistance = 2 * asin(sqrt(pow(sin((lat1-lat2)/2),2) + cos(lat1) * cos(lat2) * pow(sin((lon1 - lon2) / 2), 2))); return deistance * 6378137; } |
| How I Get the Coordinates |
|---|
var xthis = Round(Geometry($feature).X,2); var ythis = Round(Geometry |