#include <satgeometry.h>
Inheritance diagram for SatGeometry:


Public Member Functions | |
| SatGeometry () | |
Static Public Member Functions | |
| double | distance (coordinate, coordinate) |
| void | spherical_to_cartesian (double, double, double, double &, double &, double &) |
| double | propdelay (coordinate, coordinate) |
| double | get_latitude (coordinate) |
| double | get_longitude (coordinate) |
| double | get_radius (coordinate a) |
| double | get_altitude (coordinate) |
| double | check_elevation (coordinate, coordinate, double) |
| int | are_satellites_mutually_visible (coordinate, coordinate) |
Protected Member Functions | |
| int | command () |
|
|
Definition at line 73 of file satgeometry.h.
00073 { printf("Started\n");}
|
|
||||||||||||
|
Definition at line 144 of file satgeometry.cc. References ATMOS_MARGIN, distance(), EARTH_RADIUS, FALSE, get_radius(), and TRUE. Referenced by SatLinkHandoffMgr::handoff().
00145 {
00146 // if we drop a perpendicular from the ISL to the Earth's surface,
00147 // we have a right triangle. The atmospheric margin is the minimum
00148 // ISL grazing altitude.
00149 double c, d, min_radius, grazing_radius;
00150 double radius = get_radius(first); // could just use first.r here.
00151 double distance_ = distance(first, second);
00152 c = radius * radius;
00153 d = (distance_/2) * (distance_/2);
00154 grazing_radius = (EARTH_RADIUS + ATMOS_MARGIN);
00155 min_radius = sqrt(c - d);
00156 if (min_radius >= grazing_radius) {
00157 return TRUE;
00158 } else {
00159 return FALSE;
00160 }
00161 }
|
Here is the call graph for this function:

|
||||||||||||||||
|
Definition at line 117 of file satgeometry.cc. References distance(), EARTH_RADIUS, and coordinate::r. Referenced by TermLinkHandoffMgr::handoff().
00119 {
00120 double S = satellite.r; // satellite radius
00121 double S_2 = satellite.r * satellite.r; // satellite radius^2
00122 double E = EARTH_RADIUS;
00123 double E_2 = E * E;
00124 double d, theta, alpha;
00125
00126 d = distance(satellite, terminal);
00127 if (d < sqrt(S_2 - E_2)) {
00128 // elevation angle > 0
00129 theta = acos((E_2+S_2-(d*d))/(2*E*S));
00130 alpha = acos(sin(theta) * S/d);
00131 return ( (alpha > elev_mask_) ? alpha : 0);
00132 } else
00133 return 0;
00134 }
|
Here is the call graph for this function:

|
|
Definition at line 87 of file satgeometry.h.
00087 { return 0; }
|
|
||||||||||||
|
Definition at line 56 of file satgeometry.cc. References DISTANCE, coordinate::phi, coordinate::r, BaseTrace::round(), spherical_to_cartesian(), and coordinate::theta. Referenced by are_satellites_mutually_visible(), check_elevation(), SatLinkHandoffMgr::handoff(), and propdelay().
00057 {
00058 double a_x, a_y, a_z, b_x, b_y, b_z; // cartesian
00059 spherical_to_cartesian(a.r, a.theta, a.phi, a_x, a_y, a_z);
00060 spherical_to_cartesian(b.r, b.theta, b.phi, b_x, b_y, b_z);
00061 return (BaseTrace::round(DISTANCE(a_x, a_y, a_z, b_x, b_y, b_z), 1.0E+8));
00062
00063
00064 }
|
Here is the call graph for this function:

|
|
Definition at line 81 of file satgeometry.cc. References EARTH_RADIUS, and coordinate::r.
00082 {
00083 return (a.r - EARTH_RADIUS);
00084 }
|
|
|
Definition at line 87 of file satgeometry.cc. References PI, and coordinate::theta. Referenced by SatNode::dumpSats(), SatTrace::format(), and SatLinkHandoffMgr::handoff().
|
|
|
Definition at line 96 of file satgeometry.cc. References EARTH_PERIOD, NOW, coordinate::phi, PI, and SatPosition::time_advance_. Referenced by SatNode::dumpSats(), SatTrace::format(), and SatLinkHandoffMgr::handoff().
00097 {
00098 double period = EARTH_PERIOD; // period of earth in seconds
00099 // adjust longitude so that it is earth-centric (i.e., account
00100 // for earth rotating beneath).
00101 double earth_longitude = fmod((coord_.phi -
00102 (fmod(NOW + SatPosition::time_advance_,period)/period) * 2*PI),
00103 2*PI);
00104 // Bring earth_longitude to be within (-PI, PI)
00105 if (earth_longitude < (-1*PI))
00106 earth_longitude = 2*PI + earth_longitude;
00107 if (earth_longitude > PI)
00108 earth_longitude = (-(2*PI - earth_longitude));
00109 if (fabs(earth_longitude) < 0.0001)
00110 return 0; // To avoid trace output of "-0.00"
00111 else
00112 return (earth_longitude);
00113 }
|
|
|
Definition at line 80 of file satgeometry.h. References coordinate::r. Referenced by are_satellites_mutually_visible().
00080 { return a.r; }
|
|
||||||||||||
|
Definition at line 75 of file satgeometry.cc. References distance(), LIGHT, and BaseTrace::round(). Referenced by SatChannel::get_pdelay().
00076 {
00077 double delay = distance(a, b)/LIGHT;
00078 return (BaseTrace::round(delay, 1.0E+8));
00079 }
|
Here is the call graph for this function:

|
||||||||||||||||||||||||||||
|
Definition at line 66 of file satgeometry.cc. Referenced by distance().
00068 {
00069 X = R * sin(Theta) * cos (Phi);
00070 Y = R * sin(Theta) * sin (Phi);
00071 Z = R * cos(Theta);
00072 }
|
1.3.3