Fixed orbital calculations . . . again. This time, the results are in line with reality.

pull/3/head
Chris Laurel 2001-04-19 02:20:00 +00:00
parent b812e7ade0
commit b51c779920
1 changed files with 5 additions and 5 deletions

View File

@ -64,14 +64,14 @@ Point3d EllipticalOrbit::positionAtTime(double t) const
double eccAnomaly = meanAnomaly;
// eccAnomaly = solveKeplerSeries(meanAnomaly, eccentricity);
double x = semiMajorAxis * (-cos(eccAnomaly) - eccentricity);
double z = semiMajorAxis * sqrt(1 - square(eccentricity)) * -sin(eccAnomaly);
double x = semiMajorAxis * (cos(eccAnomaly) - eccentricity);
double z = semiMajorAxis * sqrt(1 - square(eccentricity)) * sin(eccAnomaly);
Mat3d R = (Mat3d::yrotation(ascendingNode) *
Mat3d R = (Mat3d::yrotation(-ascendingNode) *
Mat3d::xrotation(inclination) *
Mat3d::yrotation(argOfPeriapsis - ascendingNode));
Mat3d::yrotation(-argOfPeriapsis));
return Point3d(x, 0, z) * R;
return R * Point3d(x, 0, z);
}