StelSphereGeometry.cpp   StelSphereGeometry.cpp
skipping to change at line 476 skipping to change at line 476
if (u[0]==0. && u[1]==0. && u[2]==0.) if (u[0]==0. && u[1]==0. && u[2]==0.)
{ {
// The planes are parallel // The planes are parallel
return false; return false;
} }
u.normalize(); u.normalize();
// u gives the direction of the line, still need to find a suitable start point p0 // u gives the direction of the line, still need to find a suitable start point p0
// Find the axis on which the line varies the fastest, and solve the system for value == 0 on this axis // Find the axis on which the line varies the fastest, and solve the system for value == 0 on this axis
int maxI = (fabs(u[0])>=fabs(u[1])) ? (fabs(u[0])>=fabs(u[2]) ? 0 : 2) : (fabs(u[2])>fabs(u[1]) ? 2 : 1); int maxI = (fabs(u[0])>=fabs(u[1])) ? (fabs(u[0])>=fabs(u[2]) ? 0 : 2) : (fabs(u[2])>fabs(u[1]) ? 2 : 1);
Vec3d p0(0); Vec3d p0(0.);
switch (maxI) switch (maxI)
{ {
case 0: case 0:
{ {
// Intersection of the line with the plane x=0 // Intersection of the line with the plane x=0
const double denom = b1*c2-b2*c1; const double denom = b1*c2-b2*c1;
p0[1] = (d2*c1-d1*c2)/denom; p0[1] = (d2*c1-d1*c2)/denom;
p0[2] = (d1*b2-d2*b1)/denom; p0[2] = (d1*b2-d2*b1)/denom;
break; break;
} }
skipping to change at line 1115 skipping to change at line 1115
return u; return u;
else else
return -u; return -u;
} }
/////////////////////////////////////////////////////////////////////////// //// /////////////////////////////////////////////////////////////////////////// ////
// Methods for SphericalRegionP // Methods for SphericalRegionP
/////////////////////////////////////////////////////////////////////////// //// /////////////////////////////////////////////////////////////////////////// ////
{ {