#include <orbit.h>
Inheritance diagram for EllipticalOrbit:


Public Member Functions | |
| EllipticalOrbit (double, double, double, double, double, double, double, double _epoch=2451545.0) | |
| double | getBoundingRadius () const |
| double | getPeriod () const |
| Point3d | positionAtTime (double) const |
| virtual void | sample (double, double, int, OrbitSampleProc &) const |
Private Member Functions | |
| double | eccentricAnomaly (double) const |
| Point3d | positionAtE (double) const |
Private Attributes | |
| double | argOfPeriapsis |
| double | ascendingNode |
| double | eccentricity |
| double | epoch |
| double | inclination |
| double | meanAnomalyAtEpoch |
| double | pericenterDistance |
| double | period |
|
||||||||||||||||||||||||||||||||||||
|
Definition at line 23 of file orbit.cpp. 00030 : 00031 pericenterDistance(_pericenterDistance), 00032 eccentricity(_eccentricity), 00033 inclination(_inclination), 00034 ascendingNode(_ascendingNode), 00035 argOfPeriapsis(_argOfPeriapsis), 00036 meanAnomalyAtEpoch(_meanAnomalyAtEpoch), 00037 period(_period), 00038 epoch(_epoch) 00039 { 00040 }
|
|
|
Definition at line 118 of file orbit.cpp. References eccentricity, log(), sign(), sin(), and solve_iteration_fixed(). Referenced by positionAtTime(). 00119 {
00120 if (eccentricity == 0.0)
00121 {
00122 // Circular orbit
00123 return M;
00124 }
00125 else if (eccentricity < 0.2)
00126 {
00127 // Low eccentricity, so use the standard iteration technique
00128 Solution sol = solve_iteration_fixed(SolveKeplerFunc1(eccentricity, M), M, 5);
00129 return sol.first;
00130 }
00131 else if (eccentricity < 0.9)
00132 {
00133 // Higher eccentricity elliptical orbit; use a more complex but
00134 // much faster converging iteration.
00135 Solution sol = solve_iteration_fixed(SolveKeplerFunc2(eccentricity, M), M, 6);
00136 // Debugging
00137 // printf("ecc: %f, error: %f mas\n",
00138 // eccentricity, radToDeg(sol.second) * 3600000);
00139 return sol.first;
00140 }
00141 else if (eccentricity < 1.0)
00142 {
00143 // Extremely stable Laguerre-Conway method for solving Kepler's
00144 // equation. Only use this for high-eccentricity orbits, as it
00145 // requires more calcuation.
00146 double E = M + 0.85 * eccentricity * sign(sin(M));
00147 Solution sol = solve_iteration_fixed(SolveKeplerLaguerreConway(eccentricity, M), E, 8);
00148 return sol.first;
00149 }
00150 else if (eccentricity == 1.0)
00151 {
00152 // Nearly parabolic orbit; very common for comets
00153 // TODO: handle this
00154 return M;
00155 }
00156 else
00157 {
00158 // Laguerre-Conway method for hyperbolic (ecc > 1) orbits.
00159 double E = log(2 * M / eccentricity + 1.85);
00160 Solution sol = solve_iteration_fixed(SolveKeplerLaguerreConwayHyp(eccentricity, M), E, 30);
00161 return sol.first;
00162 }
00163 }
|
|
|
Implements Orbit. Definition at line 215 of file orbit.cpp. References eccentricity, and pericenterDistance. Referenced by MixedOrbit::MixedOrbit(). 00216 {
00217 // TODO: watch out for unbounded parabolic and hyperbolic orbits
00218 return pericenterDistance * ((1.0 + eccentricity) / (1.0 - eccentricity));
00219 }
|
|
|
Implements Orbit. Definition at line 209 of file orbit.cpp. References period. 00210 {
00211 return period;
00212 }
|
|
|
Definition at line 166 of file orbit.cpp. References argOfPeriapsis, ascendingNode, cos(), eccentricity, inclination, pericenterDistance, sin(), sqrt(), square(), Matrix3< T >::xrotation(), and Matrix3< T >::yrotation(). Referenced by positionAtTime(), and sample(). 00167 {
00168 double x, z;
00169
00170 if (eccentricity < 1.0)
00171 {
00172 double a = pericenterDistance / (1.0 - eccentricity);
00173 x = a * (cos(E) - eccentricity);
00174 z = a * sqrt(1 - square(eccentricity)) * -sin(E);
00175 }
00176 else if (eccentricity > 1.0)
00177 {
00178 double a = pericenterDistance / (1.0 - eccentricity);
00179 x = -a * (eccentricity - cosh(E));
00180 z = -a * sqrt(square(eccentricity) - 1) * -sinh(E);
00181 }
00182 else
00183 {
00184 // TODO: Handle parabolic orbits
00185 x = 0.0;
00186 z = 0.0;
00187 }
00188
00189 Mat3d R = (Mat3d::yrotation(ascendingNode) *
00190 Mat3d::xrotation(inclination) *
00191 Mat3d::yrotation(argOfPeriapsis));
00192
00193 return R * Point3d(x, 0, z);
00194 }
|
|
|
Implements Orbit. Definition at line 198 of file orbit.cpp. References eccentricAnomaly(), epoch, meanAnomalyAtEpoch, period, PI, and positionAtE(). Referenced by MixedOrbit::positionAtTime(). 00199 {
00200 t = t - epoch;
00201 double meanMotion = 2.0 * PI / period;
00202 double meanAnomaly = meanAnomalyAtEpoch + t * meanMotion;
00203 double E = eccentricAnomaly(meanAnomaly);
00204
00205 return positionAtE(E);
00206 }
|
|
||||||||||||||||||||
|
Implements Orbit. Definition at line 222 of file orbit.cpp. References PI, and positionAtE(). 00224 {
00225 double dE = 2 * PI / (double) nSamples;
00226 for (int i = 0; i < nSamples; i++)
00227 proc.sample(t, positionAtE(dE * i));
00228 }
|
|
|
Definition at line 54 of file orbit.h. Referenced by positionAtE(). |
|
|
Definition at line 53 of file orbit.h. Referenced by positionAtE(). |
|
|
Definition at line 51 of file orbit.h. Referenced by eccentricAnomaly(), getBoundingRadius(), and positionAtE(). |
|
|
Definition at line 57 of file orbit.h. Referenced by positionAtTime(). |
|
|
Definition at line 52 of file orbit.h. Referenced by positionAtE(). |
|
|
Definition at line 55 of file orbit.h. Referenced by positionAtTime(). |
|
|
Definition at line 50 of file orbit.h. Referenced by getBoundingRadius(), and positionAtE(). |
|
|
Definition at line 56 of file orbit.h. Referenced by getPeriod(), and positionAtTime(). |
1.4.1