13 const double ZDu_Max = 85.0;
15 Eigen::Vector3d obsPos = obsCoord.
getVecPos();
18 double const xr = obsPos(0);
19 double const yr = obsPos(1);
20 double const zr = obsPos(2);
23 double const rxymag =
hypot(xr, yr);
24 double const rxysq = rxymag * rxymag;
27 if (rxysq * std::numeric_limits<double>::epsilon() <= std::numeric_limits<double>::min()) {
28 if ((rxysq + (zr * zr)) * std::numeric_limits<double>::epsilon() <= std::numeric_limits<double>::min()) {
30 throw std::runtime_error(
"obsPos too short");
37 double zdr =
atan2d(rxymag, zr);
49 double tanZD =
tand(zdr);
50 zdu = zdr + (site.
refCoA * tanZD) + (site.
refCoB * tanZD * tanZD * tanZD);
60 double ZDu_iter = ZDu_Max;
61 for (
int iter = 0; iter < 2; ++iter) {
62 double ZDr_iter = ZDu_iter + ZDr_u;
63 double cosZD =
cosd(ZDr_iter);
64 double tanZD =
tand(ZDr_iter);
65 ZDr_u = ZDr_u - ((ZDr_u + (site.
refCoA * tanZD) + (site.
refCoB * tanZD * tanZD * tanZD)) /
72 Eigen::Vector3d appTopoPos;
76 rxymag *
tand(90.0 - zdu);
77 return Coord(appTopoPos);
double tand(double ang)
tangent of angle in degrees
double hypot(double x, double y)
double cosd(double ang)
cosine of angle in degrees
double atan2d(double x, double y)
arctangent2 in degrees
Eigen::Vector3d const getVecPos() const
Coord appTopoFromObs(Coord const &obsCoord, Site const &site)