Calculating distance between two longitude and latitude values

Hi All,

I was wondering if someone could look at this to help identify an error. I am using the Haversine formula to calculate this but I seem to be going wrong somewhere in this but can’t seem to pinpoint it, any help would be appreciated:
I have created this based on the formula on page 94/95:

My output value is not matching what online calculator is giving (which is accurate):
http://www.onlineconversion.com/map_greatcircle_distance.htm

You have a couple of errors in the Calculate Distance custom event. One is where you calculating the variable A you adding the wrong result of the power, cosine and sine operations. The other is that since you working with radians, you should use the radian implementation of atan2. Easier to explain in a pic, so here a pic of how it should be:

Thank you for this, worked great