Lab 1: Converting Cartesian Coordinates to Latitude/Longitude/Height
Due: in class September 2
Given Cartesian (XYZ) coordinates in meters for three GPS receivers:
- 302737.6281 5636031.5538 2979349.8064
- -1283388.8693 -4713016.9053 4090191.0471
- -2389025.4954 5043316.8722 -3078530.7858
Your main code should define the station coordinates given above
and call a Matlab function that computes latitude, longitude, and height
(
,
,
h). Submit your answers in
degrees (for latitude and longitude) with
7 digits beyond the decimal point. Height should be given
in meters to 4 digits beyond the decimal point.
Algorithm:
- a = 6378137.0 meters (equatorial radius for the Earth)
- b = 6356752.31425 meters (polar radius for the Earth)
- e2 = (a2 - b2)/a2
- Longitude is simply the arc tangent of Y/X.
- To compute latitude and height, follow these steps:
- Compute
- Compute approximate value of latitude,
- Compute approximate value of N,
- Compute ellipsoidal height h
- Compute improved value for latitude
- Check another iteration. If latitude has converged, you are done,
otherwise iterate.
Use a convergence criterion of 10-10 radians in latitude.
Turn in: your (commented) code and your answers.
Hints:
Make sure you calculate longitude correctly. Should you
use atan or atan2?
Make sure your calculations go thru your loop more than once!
If they don't, you have probably set up your convergence criterion
wrong.
Does Matlab return trigonometric values in radians or degrees?