#include <satposition.h>
Inheritance diagram for PolarSatPosition:


Public Member Functions | |
| PolarSatPosition (double=1000, double=90, double=0, double=0, double=0) | |
| virtual coordinate | coord () |
| void | set (double Altitude, double Lon, double Alpha, double inclination=90) |
| bool | isascending () |
| PolarSatPosition * | next () |
| int | plane () |
| int | type () |
| double | period () |
| Node * | node () |
Static Public Attributes | |
| double | time_advance_ = 0 |
Protected Member Functions | |
| int | command (int argc, const char *const *argv) |
Protected Attributes | |
| PolarSatPosition * | next_ |
| int | plane_ |
| double | inclination_ |
| coordinate | initial_ |
| double | period_ |
| int | type_ |
| Node * | node_ |
|
||||||||||||||||||||||||
|
Definition at line 172 of file satposition.cc. References plane_, POSITION_SAT_POLAR, set(), and SatPosition::type_.
|
Here is the call graph for this function:

|
||||||||||||
|
Reimplemented from SatPosition. Definition at line 295 of file satposition.cc. References SatPosition::command(), and next_.
00295 {
00296 Tcl& tcl = Tcl::instance();
00297 if (argc == 2) {
00298 }
00299 if (argc == 3) {
00300 if (strcmp(argv[1], "set_next") == 0) {
00301 next_ = (PolarSatPosition *) TclObject::lookup(argv[2]);
00302 if (next_ == 0) {
00303 tcl.resultf("no such object %s", argv[2]);
00304 return (TCL_ERROR);
00305 }
00306 return (TCL_OK);
00307 }
00308 }
00309 return (SatPosition::command(argc, argv));
00310 }
|
Here is the call graph for this function:

|
|
Implements SatPosition. Definition at line 238 of file satposition.cc. References inclination_, SatPosition::initial_, NOW, SatPosition::period_, coordinate::phi, PI, coordinate::r, coordinate::theta, and SatPosition::time_advance_. Referenced by SatLinkHandoffMgr::handoff(), and TermLinkHandoffMgr::handoff().
00239 {
00240 coordinate current;
00241 double partial; // fraction of orbit period completed
00242 partial =
00243 (fmod(NOW + time_advance_, period_)/period_) * 2*PI; //rad
00244 double theta_cur, phi_cur, theta_new, phi_new;
00245
00246 // Compute current orbit-centric coordinates:
00247 // theta_cur adds effects of time (orbital rotation) to initial_.theta
00248 theta_cur = fmod(initial_.theta + partial, 2*PI);
00249 phi_cur = initial_.phi;
00250 // Reminder: theta_cur and phi_cur are temporal translations of
00251 // initial parameters and are NOT true spherical coordinates.
00252 //
00253 // Now generate actual spherical coordinates,
00254 // with 0 < theta_new < PI and 0 < phi_new < 360
00255
00256 if (inclination_ < PI) {
00257 // asin returns value between -PI/2 and PI/2, so
00258 // theta_new guaranteed to be between 0 and PI
00259 theta_new = PI/2 - asin(sin(inclination_) * sin(theta_cur));
00260 // if theta_new is between PI/2 and 3*PI/2, must correct
00261 // for return value of atan()
00262 if (theta_cur > PI/2 && theta_cur < 3*PI/2)
00263 phi_new = atan(cos(inclination_) * tan(theta_cur)) +
00264 phi_cur + PI;
00265 else
00266 phi_new = atan(cos(inclination_) * tan(theta_cur)) +
00267 phi_cur;
00268 phi_new = fmod(phi_new + 2*PI, 2*PI);
00269 } else
00270 printf("ERROR: inclination_ > PI\n");
00271
00272 current.r = initial_.r;
00273 current.theta = theta_new;
00274 current.phi = phi_new;
00275 return current;
00276 }
|
|
|
Definition at line 284 of file satposition.cc. References SatPosition::initial_, NOW, SatPosition::period_, PI, coordinate::theta, and SatPosition::time_advance_.
|
|
|
Definition at line 82 of file satposition.h. References next_. Referenced by SatLinkHandoffMgr::handoff(), and TermLinkHandoffMgr::handoff().
00082 { return next_; }
|
|
|
Definition at line 62 of file satposition.h. References SatPosition::node_. Referenced by SatLinkHandoffMgr::handoff(), and TermLinkHandoffMgr::handoff().
00062 { return node_; }
|
|
|
Definition at line 61 of file satposition.h. References SatPosition::period_.
00061 { return period_; }
|
|
|
Definition at line 83 of file satposition.h. References plane_. Referenced by SatNode::dumpSats(), and SatLinkHandoffMgr::handoff().
00083 { return plane_; }
|
|
||||||||||||||||||||
|
Definition at line 193 of file satposition.cc. References DEG_TO_RAD, EARTH_RADIUS, inclination_, SatPosition::initial_, MU, SatPosition::period_, coordinate::phi, PI, coordinate::r, and coordinate::theta. Referenced by PolarSatPosition().
00194 {
00195 if (Altitude < 0) {
00196 fprintf(stderr, "PolarSatPosition: altitude out of \
00197 bounds: %f\n", Altitude);
00198 exit(1);
00199 }
00200 initial_.r = Altitude + EARTH_RADIUS; // Altitude in km above the earth
00201 if (Alpha < 0 || Alpha >= 360) {
00202 fprintf(stderr, "PolarSatPosition: alpha out of bounds: %f\n",
00203 Alpha);
00204 exit(1);
00205 }
00206 initial_.theta = DEG_TO_RAD(Alpha);
00207 if (Lon < -180 || Lon > 180) {
00208 fprintf(stderr, "PolarSatPosition: lon out of bounds: %f\n",
00209 Lon);
00210 exit(1);
00211 }
00212 if (Lon < 0)
00213 initial_.phi = DEG_TO_RAD(360 + Lon);
00214 else
00215 initial_.phi = DEG_TO_RAD(Lon);
00216 if (Incl < 0 || Incl > 180) {
00217 // retrograde orbits = (90 < Inclination < 180)
00218 fprintf(stderr, "PolarSatPosition: inclination out of \
00219 bounds: %f\n", Incl);
00220 exit(1);
00221 }
00222 inclination_ = DEG_TO_RAD(Incl);
00223 // XXX: can't use "num = pow(initial_.r,3)" here because of linux lib
00224 double num = initial_.r * initial_.r * initial_.r;
00225 period_ = 2 * PI * sqrt(num/MU); // seconds
00226 }
|
|
|
Definition at line 60 of file satposition.h. References SatPosition::type_. Referenced by SatNode::dumpSats(), and TermLinkHandoffMgr::handoff().
00060 { return type_; }
|
|
|
Definition at line 89 of file satposition.h. |
|
|
Definition at line 69 of file satposition.h. Referenced by GeoSatPosition::coord(), coord(), TermSatPosition::coord(), GeoSatPosition::GeoSatPosition(), isascending(), GeoSatPosition::set(), set(), TermSatPosition::set(), and TermSatPosition::TermSatPosition(). |
|
|
Definition at line 87 of file satposition.h. |
|
|
Definition at line 72 of file satposition.h. Referenced by SatPosition::command(), and SatPosition::node(). |
|
|
Definition at line 70 of file satposition.h. Referenced by GeoSatPosition::coord(), coord(), TermSatPosition::coord(), GeoSatPosition::GeoSatPosition(), isascending(), SatPosition::period(), set(), and TermSatPosition::TermSatPosition(). |
|
|
Definition at line 88 of file satposition.h. Referenced by plane(), and PolarSatPosition(). |
|
|
Definition at line 96 of file satposition.cc. Referenced by GeoSatPosition::coord(), coord(), TermSatPosition::coord(), SatGeometry::get_longitude(), isascending(), and SatPosition::SatPosition(). |
|
|
Definition at line 71 of file satposition.h. Referenced by GeoSatPosition::GeoSatPosition(), PolarSatPosition(), TermSatPosition::TermSatPosition(), and SatPosition::type(). |
1.3.3