StelObserver.cpp   StelObserver.cpp
skipping to change at line 121 skipping to change at line 121
m.r[ 3] = 0; m.r[ 3] = 0;
m.r[ 7] = 0; m.r[ 7] = 0;
m.r[11] = 0; m.r[11] = 0;
m.r[15] = 1.0; m.r[15] = 1.0;
setRotEquatorialToVsop87(m); setRotEquatorialToVsop87(m);
} }
Vec3d ArtificialPlanet::getRot(const Planet* p) Vec3d ArtificialPlanet::getRot(const Planet* p)
{ {
const Mat4d m(p->getRotEquatorialToVsop87()); const Mat4d m(p->getRotEquatorialToVsop87());
const double cos_r1 = sqrt(m.r[0]*m.r[0]+m.r[8]*m.r[8]); const double cos_r1 = std::sqrt(m.r[0]*m.r[0]+m.r[8]*m.r[8]);
Vec3d r; Vec3d r;
r[1] = atan2(m.r[4],cos_r1); r[1] = atan2(m.r[4],cos_r1);
// not well defined if cos(r[1])==0: // not well defined if cos(r[1])==0:
if (cos_r1 <= 0.0) if (cos_r1 <= 0.0)
{ {
// if (m.r[4]>0.0) sin,cos(a-p)=m.r[ 9],m.r[10] // if (m.r[4]>0.0) sin,cos(a-p)=m.r[ 9],m.r[10]
// else sin,cos(a+p)=m.r[ 9],m.r[10] // else sin,cos(a+p)=m.r[ 9],m.r[10]
// so lets say p=0: // so lets say p=0:
r[2] = 0.0; r[2] = 0.0;
r[0] = atan2(m.r[9],m.r[10]); r[0] = atan2(m.r[9],m.r[10]);
End of changes. 1 change blocks.
1 lines changed or deleted 1 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/