-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsiteVector.m
More file actions
31 lines (25 loc) · 862 Bytes
/
siteVector.m
File metadata and controls
31 lines (25 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
%{
Author: Shane Kramer/Professor Edward Brown (UCCS)
Course: SPCE 5025 Fundamentals Of Astronautics
Date: 04.09.15
---------------------------------------------------
This function computes ECEF site vectr based on geodetic
coordinates provided:
lat: geodetic latitude of site in radians
long: longitude of site in radians
alt: geodetic altitude of site
%}
function [ xb, yb, zb ] = siteVector( lat, lon, alt)
% Establish constants for our model
% ----------------------------------------------------
global Re;
global e2;
sinlat = sin(lat);
coslat = cos(lat);
sinlon = sin(lon);
coslon = cos(lon);
S = sqrt(1-e2*sinlat^2);
xb = (Re/S + alt)*coslat*coslon;
yb = (Re/S + alt)*coslat*sinlon;
zb = ((Re*(1-e2))/S + alt)*sinlat;
end