Compensated for quaternion to matrix conversion fix; reversed order of transfomations in getEclipticalToGeographic()

This commit is contained in:
Chris Laurel 2001-05-26 19:38:45 +00:00
parent 3f8ec985fd
commit da0035e88c

View file

@ -217,14 +217,14 @@ Point3d Body::getHeliocentricPosition(double when)
Quatd Body::getEclipticalToEquatorial()
{
Quatd q(1);
q.xrotate(obliquity);
q.xrotate(-obliquity);
return q;
}
Quatd Body::getEclipticalToGeographic(double when)
{
return getEclipticalToEquatorial() * getEquatorialToGeographic(when);
return getEquatorialToGeographic(when) * getEclipticalToEquatorial();
}
@ -240,7 +240,7 @@ Quatd Body::getEquatorialToGeographic(double when)
double remainder = rotations - wholeRotations;
Quatd q(1);
q.yrotate(-remainder * 2 * PI - getRotationPhase());
q.yrotate(remainder * 2 * PI + getRotationPhase());
return q;
}