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.
- Cartesian station location (m):
-1283387.6627
-4713015.5351
4090190.4704
- Cartesian satellite location for PRN 24 (m):
X = -11918707.0438537
Y = -23755879.2115591
Z = -75141.8219498
What to do:
- Your main code should define XYZ for satellite and receiver.
- Convert receiver XYZ to lat/long/height.
- Compute the local up unit vector for the receiver:
where
and
are
latitude and longitude.
- Compute the vector that points from the receiver to the satellite.
- 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:
- Compute the angle between the two vectors. This angle
is called the
zenith angle. Dig out your calculus book, and remind yourself how
the dot product can be used to determine the angle between two vectors.
- Compute the elevation angle. Elevation angle is defined (in
degrees): elevation angle = 90 - zenith angle. Graphically, elevation
angle is the angle with respect to the local horizon.
- Have your code check to see that the elevation angle is negative.
If it is, print out a warning.
- 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).