Homework 1: Elevation Angle of a Satellite


Due: in lab September 5.

Goal: Write a Matlab function to compute the elevation angle of a GPS satellite with respect to the given receiver location. Why? The elevation angle of a satellite is useful to know when you are trying to understand the different error sources in GPS.

  1. Cartesian station location (m):
      -1283387.6627
      -4713015.5351
      4090190.4704

  2. Cartesian satellite location for PRN 24 (m):
      X = -11918707.0438537
      Y = -23755879.2115591
      Z = -75141.8219498

What to do:

  1. Your main code should define XYZ for satellite and receiver.

  2. Convert receiver XYZ to lat/long/height.

  3. Compute the local up unit vector for the receiver:

    where and are latitude and longitude.

  4. Compute the vector that points from the receiver to the satellite.

  5. You should now send both the vectors (up vector and the vector that points from the receiver to the satellite) to a function to compute the elevation angle. In the elevation angle function:

  6. Have your code check to see that the elevation angle is negative. If it is, print out a warning.

  7. Print out elevation angle in degrees, to 4 decimal places.

Turn in: all new code (i.e. I don't need to see the lat/long/height code again).