StelProjectorClasses.cpp   StelProjectorClasses.cpp 
skipping to change at line 179 skipping to change at line 179
double StelProjectorFisheye::viewScalingFactorToFov(double vsf) const double StelProjectorFisheye::viewScalingFactorToFov(double vsf) const
{ {
return vsf; return vsf;
} }
double StelProjectorFisheye::deltaZoom(double fov) const double StelProjectorFisheye::deltaZoom(double fov) const
{ {
return fov; return fov;
} }
QString StelProjectorHammer::getNameI18() const
{
return q_("Hammer-Aitoff");
}
QString StelProjectorHammer::getDescriptionI18() const
{
return q_("The Hammer projection is an equal-area map projection, de
scribed by Ernst Hammer in 1892 and directly inspired by the Aitoff project
ion.");
}
bool StelProjectorHammer::backward(Vec3d &v) const
{
const double zsq = 1.-0.25*0.25*v[0]*v[0]-0.5*0.5*v[1]*v[1];
const double z = zsq<0. ? 0. : std::sqrt(zsq);
const bool ret = 0.25*v[0]*v[0]+v[1]*v[1]<2.0; // This is stolen fro
m glunatic
const double alpha = 2.*std::atan2(z*v[0],(2.*(2.*zsq-1.)));
const double delta = std::asin(v[1]*z);
const double cd = std::cos(delta);
v[2] = - cd * std::cos(alpha);
v[0] = cd * std::sin(alpha);
v[1] = v[1]*z;
return ret;
}
double StelProjectorHammer::fovToViewScalingFactor(double fov) const
{
return fov;
}
double StelProjectorHammer::viewScalingFactorToFov(double vsf) const
{
return vsf;
}
double StelProjectorHammer::deltaZoom(double fov) const
{
return fov;
}
QString StelProjectorCylinder::getNameI18() const QString StelProjectorCylinder::getNameI18() const
{ {
return q_("Cylinder"); return q_("Cylinder");
} }
QString StelProjectorCylinder::getDescriptionI18() const QString StelProjectorCylinder::getDescriptionI18() const
{ {
return q_("The full name of this projection mode is <i>cylindrical e quidistant projection</i>. With this projection all parallels are equally s paced."); return q_("The full name of this projection mode is <i>cylindrical e quidistant projection</i>. With this projection all parallels are equally s paced.");
} }
skipping to change at line 203 skipping to change at line 242
const double alpha = std::atan2(v[0],-v[2]); const double alpha = std::atan2(v[0],-v[2]);
const double delta = std::asin(v[1]/r); const double delta = std::asin(v[1]/r);
v[0] = alpha; v[0] = alpha;
v[1] = delta; v[1] = delta;
v[2] = r; v[2] = r;
return rval; return rval;
} }
bool StelProjectorCylinder::backward(Vec3d &v) const bool StelProjectorCylinder::backward(Vec3d &v) const
{ {
const bool rval = v[1]<M_PI_2 && v[1]>-M_PI_2; const bool rval = v[1]<M_PI_2 && v[1]>-M_PI_2 && v[0]>-M_PI && v[0]< M_PI;
const double cd = std::cos(v[1]); const double cd = std::cos(v[1]);
v[2] = - cd * std::cos(v[0]); v[2] = - cd * std::cos(v[0]);
v[0] = cd * std::sin(v[0]); v[0] = cd * std::sin(v[0]);
v[1] = std::sin(v[1]); v[1] = std::sin(v[1]);
return rval; return rval;
} }
double StelProjectorCylinder::fovToViewScalingFactor(double fov) const double StelProjectorCylinder::fovToViewScalingFactor(double fov) const
{ {
return fov; return fov;
skipping to change at line 249 skipping to change at line 288
const bool rval = (-r < v[1] && v[1] < r); const bool rval = (-r < v[1] && v[1] < r);
const double sin_delta = v[1]/r; const double sin_delta = v[1]/r;
v[0] = std::atan2(v[0],-v[2]); v[0] = std::atan2(v[0],-v[2]);
v[1] = 0.5*std::log((1.0+sin_delta)/(1.0-sin_delta)); v[1] = 0.5*std::log((1.0+sin_delta)/(1.0-sin_delta));
v[2] = r; v[2] = r;
return rval; return rval;
} }
bool StelProjectorMercator::backward(Vec3d &v) const bool StelProjectorMercator::backward(Vec3d &v) const
{ {
const bool rval = !(v[1]>M_PI_2 || v[1]<-M_PI_2); const bool rval = v[1]<M_PI_2 && v[1]>-M_PI_2 && v[0]>-M_PI && v[0]< M_PI;
const double E = std::exp(v[1]); const double E = std::exp(v[1]);
const double h = E*E; const double h = E*E;
const double h1 = 1.0/(1.0+h); const double h1 = 1.0/(1.0+h);
const double sin_delta = (h-1.0)*h1; const double sin_delta = (h-1.0)*h1;
const double cos_delta = 2.0*E*h1; const double cos_delta = 2.0*E*h1;
v[2] = - cos_delta * std::cos(v[0]); v[2] = - cos_delta * std::cos(v[0]);
v[0] = cos_delta * std::sin(v[0]); v[0] = cos_delta * std::sin(v[0]);
v[1] = sin_delta; v[1] = sin_delta;
return rval; return rval;
} }
 End of changes. 3 change blocks. 
2 lines changed or deleted 44 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/