# Thread: Evaluating Lat Long Equations

1. ## Evaluating Lat Long Equations

Just recently I came across the following statement
Suppose we are discussing latitude and longitude in WGS84 and we want to be accurate. Both meridian radius of curvature M (latitude length) and radius of curvature of parallels R (longitude length) in WGS84 depend only on latitude phi and are defined as:

M = a(1 - e^2) / (1 - e^2 sin(phi)^2)^(3/2)

R = a cos(phi) / (1 - e^2 sin(phi)^2)^(1/2)

where

e is the eccentricity of the referenced ellipsoid of WGS84
a is the semi-major axis of the ellipsoid.
WGS 84 defines the semi-major axis of the WGS 84 ellipsoid a and the flattening factor of the Earth f as:

a=6378137m

1/f=298.257223563

With these defining parameters in WGS 84, we can obtain the eccentricity:

e=sqrt(2f-f^2)=0.081819191

Verification of the above equations

To verify whether the above eq. (1) and eq. (2) are correct, we will check them against the results at USGS which said, at 38 degrees North latitude, one degree of latitude equals approximately 364,000 feet (69 miles) and one degree of longitude equals 288,200 feet (54.6 miles).

To find the meridian radius of curvature M (latitude length) and radius of curvature of parallels (longitude length) at 38 degrees North latitude, we plug in a=6378137, e=0.081819191 and phi=38° into eq. (1) and eq. (2):

M = 6359629.652 m/rad

R = 5032429.322 m/rad

Furthermore, to find length of 1° of latitude and longitude, we multiply the above equations by the radian of 1°:

Length of 1° latitude = M * 1°/180° * pi = 6359629.652*1*pi/180 = 110996.4766 m = 68.970013 miles

Length of 1° longitude= R * 1°/180° * pi = 5032429.322*1*pi/180 = 87832.46103 m = 54.57656101 miles

The results are in line with the results of USGS.

Repeat the above steps but plug in phi=37°15.8298′ = 37+15.8298/60=37.26383, we can obtain:

Length of 1° latitude=68.96139 miles

Length of 1° longitude=55.11761 miles
I am trying firstly understand the equations and secondly evaluate them for accuracy. In using Office 365 for Mac, Excel refuses to recognise the formulas for M & R. Could this be because the formulas might be missing a Math Operator? Simply replacing "PHI" with the Latitude (in Decimal Degrees) still results in an error message " are you trying to enter a formula?". Next I run into an error when I tried to check the validity of the value of "e". The formula as written in the statement above returns a "Num error because we haven't define the value of "f". When I replaced "f" in the equation to determine "e", it returned the #Num error message. What am I doing wrong?

If I understand the 1/f =298.257223563 statement correctly, by transposing f= 298.257223563*1, or is this assumption incorrect?

Eventually I'd like to test the formulas to determine the lengths of 1° of Latitude and or Longitude. Any assistance would be greatly appreciated. On a side note. Supporters of Office 365 often say that the improvements under 365, significantly reduce the need to resort to VBA. Given that we are dealing with values with 9 decimals places can this overcome the limitation of floating point error, or is Office 365 still a fair way off this accuracy required?

2. Did you remember to convert Degrees to Radians (cell C9)?

Capture.JPG

Otherwise the ws formulas seem to work

3. Thank you Paul. I see that there were two math Operator symbols missing from the M & R formulas, and errr....... sadly no I did not remember the C9 bit. Must have been one of those days when I should have been in Maths class but was sitting in a chair outside the headmaster's office awaiting for some behavioural correction to be applied.

4. I never even noticed that there were *'s missing from

```M = a(1 - e^2) / (1 - e^2 sin(phi)^2)^(3/2)

R = a cos(phi) / (1 - e^2 sin(phi)^2)^(1/2)```

5. I have followed on with your worksheet Paul. Firstly I determined the actual length in meters (actually it's less than a meter) for each unit of 0.000001. The six decimal places is determined by that which is provided in Google Earth decimal degrees co-ordinates. Why you ask.... well just because.

Think of it like this. The local orienteering club has a task master who sets tasks(courses) for the members to follow to find clues. Last Tuesday, he said from your start position at 38° N and 143° East, travel 1200 mtrs north then 2300 mtrs East, and look for a clue under a rock to find the next set of clues. Could you do it? Well it depends on your methodology. I mean you could try to walk the distance using a measuring wheel, and maybe, be somewhere in the right area, but I doubt you could walk the correct heading for long enough.

If you use the standard GPS units that read in DMS, the variance between the length of a degree @38° latitude (110996.4766mtrs/3600, equates to 30.832 mtrs per unit and conversely the length of a degree at 143° longitude (87832.4610/3600, equates to 24.397mtrs which means you are looking for a rock in 752.45 sq mtrs. Not an entirely hopeless task but definitely one that would be time consuming.

If you were just a little bit smarter and had a GPS tracking unit which used decimal degrees, you end up looking for a rock inside an area less than 1 mtr. See the worksheet for the example.

The next task the next task is to write some code that determines whether you are in the Northern or Southern hemisphere and which side of the Greenwich mark you are. This then determines if the unit values are added or subtracted from the starting Lat/Lon position depending on the travel direction used to arrive at your new position.

The more astute of you will argue that this will work for small distances travelled, but will fail (less accurate) if travelling more than 1 degree, and yes I agree.

6. Do you have C27 and C28 reversed?

Capture.JPG

Took a shot at N/S and E/W in the workbook

Also attached some modules I had stored away from NOAA dealing with coordinates and stuff

Might be some stuff you can 'borrow'

7. Thank you Paul. Yes for some reason I did have the cells reversed but for the life of me I cannot recall why ( just very tired I guess). I have also noticed the modules have converted the functions from a simple two dimensional to three dimensional function. Now to go have some fun with Google Earth.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•