...
This commit is contained in:
@@ -659,30 +659,30 @@ protected:
|
||||
// HA, DEC to AZ, ALT (AZ from the South through the West)
|
||||
void hadec2azalt(double ha, double dec, double phi, double& az, double& alt) const
|
||||
{
|
||||
eraHd2ae(ha, dec, phi, &az, &alt);
|
||||
// from ERFA "from N" to "from S"
|
||||
if (az > std::numbers::pi) {
|
||||
az -= std::numbers::pi;
|
||||
} else {
|
||||
az += std::numbers::pi;
|
||||
}
|
||||
// eraHd2ae(ha, dec, phi, &az, &alt);
|
||||
// // from ERFA "from N" to "from S"
|
||||
// if (az > std::numbers::pi) {
|
||||
// az -= std::numbers::pi;
|
||||
// } else {
|
||||
// az += std::numbers::pi;
|
||||
// }
|
||||
|
||||
return;
|
||||
// return;
|
||||
|
||||
const auto cos_phi = std::cos(phi), sin_phi = std::sin(phi);
|
||||
const auto cos_dec = std::cos(dec), sin_dec = std::sin(dec);
|
||||
const auto cos_ha = std::cos(ha), sin_ha = std::sin(ha);
|
||||
|
||||
auto x = sin_phi * cos_dec * cos_ha - cos_phi * sin_dec;
|
||||
auto y = -cos_dec * sin_ha;
|
||||
auto y = cos_dec * sin_ha;
|
||||
auto z = cos_phi * cos_dec * cos_ha + sin_phi * sin_dec;
|
||||
|
||||
auto xx = x * x, yy = y * y;
|
||||
decltype(x) r;
|
||||
if (xx < yy) {
|
||||
r = yy * sqrt(1.0 + xx / yy);
|
||||
r = std::abs(y) * sqrt(1.0 + xx / yy);
|
||||
} else {
|
||||
r = xx * sqrt(1.0 + yy / xx);
|
||||
r = std::abs(x) * sqrt(1.0 + yy / xx);
|
||||
}
|
||||
|
||||
az = utils::isEqual(r, 0.0) ? 0.0 : std::atan2(y, x);
|
||||
@@ -697,10 +697,10 @@ protected:
|
||||
// AZ, ALT to HA, DEC (AZ from the South through the West)
|
||||
void azalt2hadec(double az, double alt, double phi, double& ha, double& dec) const
|
||||
{
|
||||
az += std::numbers::pi;
|
||||
eraAe2hd(az, alt, phi, &ha, &dec);
|
||||
// az += std::numbers::pi;
|
||||
// eraAe2hd(az, alt, phi, &ha, &dec);
|
||||
|
||||
return;
|
||||
// return;
|
||||
|
||||
const auto cos_phi = std::cos(phi), sin_phi = std::sin(phi);
|
||||
const auto cos_az = std::cos(az), sin_az = std::sin(az);
|
||||
@@ -713,9 +713,9 @@ protected:
|
||||
auto xx = x * x, yy = y * y;
|
||||
decltype(x) r;
|
||||
if (xx < yy) {
|
||||
r = yy * sqrt(1.0 + xx / yy);
|
||||
r = std::abs(y) * sqrt(1.0 + xx / yy);
|
||||
} else {
|
||||
r = xx * sqrt(1.0 + yy / xx);
|
||||
r = std::abs(x) * sqrt(1.0 + yy / xx);
|
||||
}
|
||||
|
||||
ha = utils::isEqual(r, 0.0) ? 0.0 : std::atan2(y, x);
|
||||
|
||||
Reference in New Issue
Block a user