Go to the documentation of this file.
51 using namespace StringUtils;
109 catch(GeometryException& ge) {
125 catch(GeometryException& ge) {
141 catch(GeometryException& ge) {
163 transformTo(Cartesian);
166 for(
int i=0; i<3; i++)
169 transformTo(savesys);
180 transformTo(Cartesian);
183 for(
int i=0; i<3; i++)
186 transformTo(savesys);
224 if(AEarth != right.AEarth || eccSquared != right.eccSquared)
226 if(right.getReferenceFrame() != refFrame)
228 if(
range(*
this,right) < tolerance)
250 if(sys ==
Unknown || sys == system)
return *
this;
262 case Unknown:
case Geodetic:
return *
this;
264 convertGeodeticToGeocentric(*
this,target,AEarth,eccSquared);
265 target.
system = Geocentric;
268 convertGeodeticToCartesian(*
this,target,AEarth,eccSquared);
269 target.
system = Cartesian;
272 convertGeodeticToGeocentric(*
this,target,AEarth,eccSquared);
274 target.
system = Spherical;
281 case Unknown:
case Geocentric:
return *
this;
283 convertGeocentricToGeodetic(*
this,target,AEarth,eccSquared);
287 convertGeocentricToCartesian(*
this,target);
288 target.
system = Cartesian;
292 target.
system = Spherical;
299 case Unknown:
case Cartesian:
return *
this;
301 convertCartesianToGeodetic(*
this,target,AEarth,eccSquared);
305 convertCartesianToGeocentric(*
this,target);
306 target.
system = Geocentric;
309 convertCartesianToSpherical(*
this,target);
310 target.
system = Spherical;
317 case Unknown:
case Spherical:
return *
this;
319 theArray[0] = 90 - theArray[0];
320 convertGeocentricToGeodetic(*
this,target,AEarth,eccSquared);
325 target.
system = Geocentric;
328 convertSphericalToCartesian(*
this,target);
329 target.
system = Cartesian;
356 if(system == Cartesian)
367 if(system == Cartesian)
378 if(system == Cartesian)
389 if(system == Geodetic)
401 if(system == Geocentric)
412 if(system == Spherical)
423 if(system == Spherical)
435 if(system != Cartesian)
447 if(system == Spherical || system == Geocentric)
458 if(system == Geodetic)
482 GeometryException ge(
"Given EllipsoidModel pointer is NULL.");
500 if(lat > 90 || lat < -90)
502 GeometryException ge(
"Invalid latitude in setGeodetic: "
510 theArray[1] += 360*(1+(
unsigned long)(theArray[1]/360));
511 else if(theArray[1] >= 360)
512 theArray[1] -= 360*(
unsigned long)(theArray[1]/360);
535 if(lat > 90 || lat < -90)
537 GeometryException ge(
"Invalid latitude in setGeocentric: "
543 GeometryException ge(
"Invalid radius in setGeocentric: "
552 theArray[1] += 360*(1+(
unsigned long)(theArray[1]/360));
553 else if(theArray[1] >= 360)
554 theArray[1] -= 360*(
unsigned long)(theArray[1]/360);
570 if(theta < 0 || theta > 180)
572 GeometryException ge(
"Invalid theta in setSpherical: "
578 GeometryException ge(
"Invalid radius in setSpherical: "
588 theArray[1] += 360*(1+(
unsigned long)(theArray[1]/360));
589 else if(theArray[1] >= 360)
590 theArray[1] -= 360*(
unsigned long)(theArray[1]/360);
659 const std::string& fmt)
667 bool hX=
false, hY=
false, hZ=
false;
668 bool hglat=
false, hlon=
false, hht=
false;
669 bool hclat=
false, hrad=
false;
670 bool htheta=
false, hphi=
false;
672 double x=0.0,
y=0.0, z=0.0, glat=0.0, lon=0.0, ht=0.0, clat=0.0,
673 rad=0.0, theta=0.0, phi=0.0;
682 while ( (s.size() > 0) && (f.size() > 0) )
687 while ( (s.length() != 0) && (f.length() != 0) && (f[0] !=
'%') )
697 if ( (s.length() == 0) || (f.length() == 0) )
705 string::size_type fieldLength = string::npos;
709 fieldLength =
asInt(f);
713 while ((!f.empty()) && (!isalpha(f[0])))
727 if (fieldLength == string::npos)
728 fieldLength = s.find(delimiter,0);
733 else if (fieldLength == string::npos)
741 string toBeRemoved = s.substr(0, fieldLength);
780 if(glat > 90. || glat < -90.) {
782 "Invalid geodetic latitude for setTostring: "
790 if(clat > 90. || clat < -90.) {
792 "Invalid geocentric latitude for setTostring: "
806 lon += 360*(1+(
unsigned long)(lon/360));
808 lon -= 360*(
unsigned long)(lon/360);
813 lon = 360.0 -
asDouble(toBeRemoved);
815 lon += 360*(1+(
unsigned long)(lon/360));
817 lon -= 360*(
unsigned long)(lon/360);
824 if(theta > 180. || theta < 0.) {
825 InvalidRequest f(
"Invalid theta for setTostring: "
833 if(theta > 90. || theta < -90.) {
834 InvalidRequest f(
"Invalid theta for setTostring: "
845 phi += 360*(1+(
unsigned long)(phi/360));
847 phi -= 360*(
unsigned long)(phi/360);
853 phi += 360*(1+(
unsigned long)(phi/360));
855 phi -= 360*(
unsigned long)(phi/360);
865 InvalidRequest f(
"Invalid radius for setTostring: "
874 InvalidRequest f(
"Invalid radius for setTostring: "
903 if ( s.length() != 0 )
907 "Processing error - parts of strings left unread - " + s);
915 "Processing error - parts of strings left unread - " + f);
920 if ( !(hX && hY && hZ) && !(hglat && hlon && hht) &&
921 !(hclat && hlon && hrad) && !(htheta && hphi && hrad)) {
922 InvalidRequest fe(
"Incomplete specification for setToString");
929 else if(hglat && hlon && hht)
931 else if(hclat && hlon && hrad)
933 else if(htheta && hphi && hrad)
941 GeometryException ge(exc);
942 ge.addText(
"Failed to convert string to Position");
945 catch(std::exception& exc)
947 GeometryException ge(exc.what());
948 ge.addText(
"Failed to convert string to Position");
985 rv =
formattedPrint(rv,
string(
"%[ 0-]?[[:digit:]]*(\\.[[:digit:]]+)?x"),
987 rv =
formattedPrint(rv,
string(
"%[ 0-]?[[:digit:]]*(\\.[[:digit:]]+)?y"),
989 rv =
formattedPrint(rv,
string(
"%[ 0-]?[[:digit:]]*(\\.[[:digit:]]+)?z"),
991 rv =
formattedPrint(rv,
string(
"%[ 0-]?[[:digit:]]*(\\.[[:digit:]]+)?X"),
992 string(
"Xf"), X()/1000);
993 rv =
formattedPrint(rv,
string(
"%[ 0-]?[[:digit:]]*(\\.[[:digit:]]+)?Y"),
994 string(
"Yf"),
Y()/1000);
995 rv =
formattedPrint(rv,
string(
"%[ 0-]?[[:digit:]]*(\\.[[:digit:]]+)?Z"),
996 string(
"Zf"), Z()/1000);
998 rv =
formattedPrint(rv,
string(
"%[ 0-]?[[:digit:]]*(\\.[[:digit:]]+)?A"),
999 string(
"Af"), geodeticLatitude());
1000 rv =
formattedPrint(rv,
string(
"%[ 0-]?[[:digit:]]*(\\.[[:digit:]]+)?a"),
1001 string(
"af"), geocentricLatitude());
1002 rv =
formattedPrint(rv,
string(
"%[ 0-]?[[:digit:]]*(\\.[[:digit:]]+)?L"),
1003 string(
"Lf"), longitude());
1004 rv =
formattedPrint(rv,
string(
"%[ 0-]?[[:digit:]]*(\\.[[:digit:]]+)?l"),
1005 string(
"lf"), longitude());
1006 rv =
formattedPrint(rv,
string(
"%[ 0-]?[[:digit:]]*(\\.[[:digit:]]+)?w"),
1007 string(
"wf"), 360-longitude());
1008 rv =
formattedPrint(rv,
string(
"%[ 0-]?[[:digit:]]*(\\.[[:digit:]]+)?W"),
1009 string(
"Wf"), 360-longitude());
1011 rv =
formattedPrint(rv,
string(
"%[ 0-]?[[:digit:]]*(\\.[[:digit:]]+)?t"),
1012 string(
"tf"), theta());
1013 rv =
formattedPrint(rv,
string(
"%[ 0-]?[[:digit:]]*(\\.[[:digit:]]+)?T"),
1015 rv =
formattedPrint(rv,
string(
"%[ 0-]?[[:digit:]]*(\\.[[:digit:]]+)?p"),
1016 string(
"pf"), phi());
1017 rv =
formattedPrint(rv,
string(
"%[ 0-]?[[:digit:]]*(\\.[[:digit:]]+)?P"),
1019 rv =
formattedPrint(rv,
string(
"%[ 0-]?[[:digit:]]*(\\.[[:digit:]]+)?r"),
1020 string(
"rf"), radius());
1021 rv =
formattedPrint(rv,
string(
"%[ 0-]?[[:digit:]]*(\\.[[:digit:]]+)?R"),
1022 string(
"Rf"), radius()/1000);
1023 rv =
formattedPrint(rv,
string(
"%[ 0-]?[[:digit:]]*(\\.[[:digit:]]+)?h"),
1024 string(
"hf"), height());
1025 rv =
formattedPrint(rv,
string(
"%[ 0-]?[[:digit:]]*(\\.[[:digit:]]+)?H"),
1026 string(
"Hf"), height()/1000);
1062 tpr[2] =
RSS(xyz[0],xyz[1],xyz[2]);
1068 tpr[0] = ::acos(xyz[2]/tpr[2]);
1074 tpr[1] = ::atan2(xyz[1],xyz[0]);
1076 if(tpr[1] < 0) tpr[1] += 360;
1093 double p,slat,N,htold,latold;
1094 p =
SQRT(xyz[0]*xyz[0]+xyz[1]*xyz[1]);
1096 llh[0] = (xyz[2] > 0 ? 90.0: -90.0);
1098 llh[2] = ::fabs(xyz[2]) - A*
SQRT(1.0-eccSq);
1101 llh[0] = ::atan2(xyz[2], p*(1.0-eccSq));
1103 for(
int i=0; i<5; i++) {
1104 slat =
::sin(llh[0]);
1105 N = A /
SQRT(1.0 - eccSq*slat*slat);
1107 llh[2] = p/
::cos(llh[0]) - N;
1109 llh[0] = ::atan2(xyz[2], p*(1.0-eccSq*(N/(N+llh[2]))));
1110 if(::fabs(llh[0]-latold) < 1.0e-9 && fabs(llh[2]-htold) < 1.0e-9 * A)
break;
1112 llh[1] = ::atan2(xyz[1],xyz[0]);
1113 if(llh[1] < 0.0) llh[1] +=
TWO_PI;
1134 double N = A/
SQRT(1.0-eccSq*slat*slat);
1137 xyz[2] = (N*(1.0-eccSq)+llh[2])*slat;
1148 convertCartesianToSpherical(xyz, llr);
1149 llr[0] = 90 - llr[0];
1160 llh[0] = 90 - llh[0];
1161 convertSphericalToCartesian(llh, xyz);
1176 double cl,p,sl,slat,N,htold,latold;
1183 llh[0] = llh[1] = 0;
1187 else if(cl < 1.e-10) {
1189 if(llr[0] < 0) llh[0] = -90;
1192 llh[2] = llr[2] - A*
SQRT(1-eccSq);
1195 llh[0] = ::atan2(sl, cl*(1.0-eccSq));
1198 for(
int i=0; i<5; i++) {
1199 slat =
::sin(llh[0]);
1200 N = A /
SQRT(1.0 - eccSq*slat*slat);
1202 llh[2] = p/
::cos(llh[0]) - N;
1204 llh[0] = ::atan2(sl, cl*(1.0-eccSq*(N/(N+llh[2]))));
1205 if(fabs(llh[0]-latold) < 1.0e-9 && ::fabs(llh[2]-htold) < 1.0e-9 * A)
break;
1223 double N = A/
SQRT(1.0-eccSq*slat*slat);
1227 llr[2] =
SQRT((N+llh[2])*(N+llh[2]) + N*eccSq*(N*eccSq-2*(N+llh[2]))*slat*slat);
1231 llr[0] = llr[1] = llr[2] = 0;
1234 if(1-::fabs(slat) < 1.e-10) {
1235 if(slat < 0) llr[0] = -90;
1241 llr[0] = ::acos((N*(1-eccSq)+llh[2])*slat/llr[2]);
1243 llr[0] = 90 - llr[0];
1255 s << p.
printf(
"%.4x m %.4y m %.4z m");
1257 s << p.
printf(
"%.8A degN %.8L degE %.4h m");
1259 s << p.
printf(
"%.8a degN %.8L degE %.4r m");
1261 s << p.
printf(
"%.8t deg %.8p deg %.4r m");
1263 s <<
" Unknown system! : " << p[0] <<
" " << p[1] <<
" " << p[2];
1278 GeometryException ge(
"Unequal geoids");
1285 double dif =
RSS(L.X()-R.
X(),L.Y()-R.
Y(),L.Z()-R.
Z());
1298 double e=(1.0-eccSq);
1299 double f=(1.0+(e*e-1.0)*slat*slat)/(1.0-eccSq*slat*slat);
1300 return (A *
SQRT(f));
1311 R.transformTo(Cartesian);
1318 catch(GeometryException& ge)
1334 double latGeodetic = R.getGeodeticLatitude()*
DEG_TO_RAD;
1335 double longGeodetic = R.getLongitude()*
DEG_TO_RAD;
1338 R.transformTo(Cartesian);
1346 GeometryException ge(
"Positions are within .1 millimeter");
1351 Triple kVector(::
cos(latGeodetic)*::
cos(longGeodetic), ::
cos(latGeodetic)*::
sin(longGeodetic), ::
sin(latGeodetic));
1353 localUp = z.
dot(kVector);
1355 cosUp = localUp/z.
mag();
1368 R.transformTo(Cartesian);
1377 catch(GeometryException& ge)
1394 double latGeodetic = R.getGeodeticLatitude()*
DEG_TO_RAD;
1395 double longGeodetic = R.getLongitude()*
DEG_TO_RAD;
1396 double localN, localE;
1397 R.transformTo(Cartesian);
1405 GeometryException ge(
"Positions are within .1 millimeter");
1410 Triple iVector(-::
sin(latGeodetic)*::
cos(longGeodetic), -::
sin(latGeodetic)*::
sin(longGeodetic), ::
cos(latGeodetic));
1412 Triple jVector(-::
sin(longGeodetic), ::
cos(longGeodetic), 0);
1415 localN = (z.
dot(iVector))/z.
mag();
1416 localE = (z.
dot(jVector))/z.
mag();
1419 double test = fabs(localN) + fabs(localE);
1422 if (test < 1.0e-16)
return 0.0;
1424 double alpha = ((::atan2(localE, localN)) *
RAD_TO_DEG);
1427 return alpha + 360.0;
1452 const double ionoht)
const
1464 double p =
PI/2.0 - el - ::asin(AEarth*::
cos(el)/(AEarth+ionoht));
1492 double W = 1.0/
SQRT(1.0-eccSquared*slat*slat);
1494 return AEarth*(1.0-eccSquared)*W*W*W;
1509 return AEarth/
SQRT(1.0-eccSquared*slat*slat);
1518 p1.transformTo(Geodetic);
1528 double r1 = radius();
1529 double r2 = target.
radius();
1530 return getZenithAngle(phi1, lambda1, phi2, lambda2, r1, r2, delta);
1537 double r1,
double r2,
1543 cos(phi1)*
cos(phi2)*
cos(lambda2-lambda1),
1547 return Angle(atan2(
sin(delta),
cos(delta) - (r1/r2)),
1557 p1.transformTo(Geodetic);
1568 double r1 = radius() / 1000.0;
1569 double r2 = target.
radius() / 1000.0;
1571 Angle zeta = getZenithAngle(phi1,lambda1,phi2,lambda2,r1,r2,delta);
1572 double rp = r1 *
sin(zeta);
1573 DEBUGTRACE(setprecision(20) <<
"pStation_position->radius_km=" << scientific << r1);
1574 DEBUGTRACE(
"pZenith_angle->sin=" << scientific <<
sin(zeta));
1575 DEBUGTRACE(
"pRay->slant.perigee_radius_km=" << scientific << rp);
1576 Angle phiP, lambdaP;
1577 if (fabs(fabs(phi1.
deg())-90) < 1e-10)
1579 phiP = (phi1.
deg() > 0) ? zeta : -zeta;
1586 (
sin(lambda2-lambda1) *
cos(phi2)) /
sin(delta),
1588 (
sin(delta) *
cos(phi1))));
1595 lambdaP = dLambda + lambda1;
1610 Position pp(getRayPerigee(target));
1615 Angle dLambda(lambda2 - lambdap);
1618 DEBUGTRACE(
"# pRay->latitude.rad=" << scientific << phip.
rad());
1619 DEBUGTRACE(
"# pRay->latitude.degree=" << scientific << phip.
deg());
1620 DEBUGTRACE(
"# pRay->latitude.sin=" << scientific << phip.
sin());
1621 DEBUGTRACE(
"# pRay->latitude.cos=" << scientific << phip.
cos());
1622 DEBUGTRACE(
"# pRay->longitude.rad=" << scientific << lambdap.
rad());
1623 DEBUGTRACE(
"# pRay->longitude.degree=" << scientific << lambdap.
deg());
1624 DEBUGTRACE(
"pRay->longitude.sin=" << scientific << lambdap.
sin());
1625 DEBUGTRACE(
"pRay->longitude.cos=" << scientific << lambdap.
cos());
1626 DEBUGTRACE(
"# pRay->satellite_position.latitude.rad=" << scientific << phi2.
rad());
1627 DEBUGTRACE(
"# pRay->satellite_position.latitude.degree=" << scientific << phi2.
deg());
1628 DEBUGTRACE(
"# pRay->satellite_position.latitude.sin=" << scientific << phi2.
sin());
1629 DEBUGTRACE(
"# pRay->satellite_position.latitude.cos=" << scientific << phi2.
cos());
1630 DEBUGTRACE(
"# pRay->satellite_position.longitude.rad=" << scientific << lambda2.
rad());
1631 DEBUGTRACE(
"# pRay->satellite_position.longitude.degree=" << scientific << lambda2.
deg());
1632 DEBUGTRACE(
"# pRay->satellite_position.longitude.sin=" << scientific << lambda2.
sin());
1633 DEBUGTRACE(
"# pRay->satellite_position.longitude.cos=" << scientific << lambda2.
cos());
1634 if (fabs(fabs(phip.
deg())-90.0) < 1e-10)
1640 sigmap =
Angle(0.0, -1.0);
1647 sigmap =
Angle(0.0, 1.0);
1660 DEBUGTRACE(
"# pRay->slant.azimuth.sin=" << scientific << sigmap.
sin());
1661 DEBUGTRACE(
"# pRay->slant.azimuth.cos=" << scientific << sigmap.
cos());
1667 double rs = sqrt(dist*dist + rp*rp);
1668 double tanDeltas = dist / rp;
1669 double cosDeltas = 1/sqrt(1+tanDeltas*tanDeltas);
1670 double sinDeltas = tanDeltas * cosDeltas;
1671 Angle phis(
sin(phip)*cosDeltas +
cos(phip)*sinDeltas*
cos(sigmap),
1674 cosDeltas-
sin(phip)*
sin(phis));
1675 double lambdas = dlambda.
deg() + lambdap.
deg();
1681 DEBUGTRACE(
"current_position.radius_km=" << scientific << (rs / 1000.0));
1682 DEBUGTRACE(
"current_position.height=" << scientific << (rv.
height() / 1000.0));
1683 DEBUGTRACE(
"current_position.latitude.rad=" << scientific << phis.
rad());
1684 DEBUGTRACE(
"current_position.latitude.degree=" << scientific << phis.
deg());
1685 DEBUGTRACE(
"current_position.latitude.sin=" << scientific << phis.
sin());
1686 DEBUGTRACE(
"current_position.latitude.cos=" << scientific << phis.
cos());
1687 DEBUGTRACE(
"current_position.longitude.degree=" << scientific << lambdas);
1709 if(s == Geodetic || s==Geocentric)
1711 if(a > 90 || a < -90)
1713 GeometryException ge(
"Invalid latitude in constructor: "
1718 bb += 360*(1+(
unsigned long)(bb/360));
1720 bb -= 360*(
unsigned long)(bb/360);
1722 if(s==Geocentric || s==Spherical)
1726 GeometryException ge(
"Invalid radius in constructor: "
1733 if(a < 0 || a > 180)
1735 GeometryException ge(
"Invalid theta in constructor: "
1740 bb += 360*(1+(
unsigned long)(bb/360));
1742 bb -= 360*(
unsigned long)(bb/360);
1756 eccSquared =
WGS84.eccSquared();
1759 tolerance = POSITION_TOLERANCE;
@ Geodetic
geodetic latitude, longitude, and height above ellipsoid
Position & setGeocentric(const double lat, const double lon, const double rad)
double radiusEarth() const noexcept
long asInt(const std::string &s)
void copyEllipsoidModelFrom(const Position &src)
bool operator==(const IonexData::IonexValType &x, const IonexData::IonexValType &y)
operator == for IonexData::IonexValType
@ Cartesian
cartesian (Earth-centered, Earth-fixed)
double rad() const
Get the angle in radians.
virtual double eccSquared() const noexcept
Position & transformTo(CoordinateSystem sys) noexcept
void initialize(const double a, const double b, const double c, CoordinateSystem s=Cartesian, const EllipsoidModel *ell=nullptr, const RefFrame &frame=RefFrame())
void setReferenceFrame(const RefFrame &frame) noexcept
SparseMatrix< T > operator+(const SparseMatrix< T > &L, const SparseMatrix< T > &R)
Matrix addition: SparseMatrix = SparseMatrix + SparseMatrix : copy, += SM.
double sin() const
Get the sine of this angle.
@ Y
Encrypted legacy GPS precise code.
double geocentricLatitude() const noexcept
Position & setTolerance(const double tol) noexcept
CoordinateSystem system
see CoordinateSystem
static void convertGeocentricToCartesian(const Triple &llr, Triple &xyz) noexcept
std::string asString(IonexStoreStrategy e)
Convert a IonexStoreStrategy to a whitespace-free string name.
double Y() const noexcept
return Y coordinate (meters)
double Z() const noexcept
return Z coordinate (meters)
Position & setSpherical(const double theta, const double phi, const double rad)
const double TWO_PI
GPS value of PI*2.
const double PI
GPS value of PI; also specified by GAL.
Position & setToString(const std::string &str, const std::string &fmt)
std::valarray< double > theArray
void setEllipsoidModel(const EllipsoidModel *ell)
double height() const noexcept
return height above ellipsoid (meters) (Geodetic).
@ Unknown
Unknown or uninitialized stategy value.
std::string & stripLeading(std::string &s, const std::string &aString, std::string::size_type num=std::string::npos)
double azimuth(const Position &Target) const
std::string printf(const char *fmt) const
double sin(gnsstk::Angle x)
static void convertCartesianToGeodetic(const Triple &xyz, Triple &llh, const double A, const double eccSq) noexcept
void setValue(double v, AngleType t)
double geodeticLatitude() const noexcept
return geodetic latitude (degrees North).
double azimuthGeodetic(const Position &Target) const
static const char * SystemNames[]
@ Rad
Value is in radians.
std::string & stripTrailing(std::string &s, const std::string &aString, std::string::size_type num=std::string::npos)
Position & setECEF(const double X, const double Y, const double Z) noexcept
const RefFrame & getReferenceFrame() const noexcept
return coordinate RefFrame
double dot(const Triple &right) const noexcept
int initialize(string &errors)
@ Sin
Value is the sine of the angle.
static const double RAD_TO_DEG
Conversion Factor from radians to degrees (units: degrees)
page HOWTO subpage DoxygenGuide Documenting Your Code page DoxygenGuide Documenting Your Code todo Flesh out this document section doctips Tips for Documenting When defining make sure that the prototype is identical between the cpp and hpp including both the namespaces and the parameter names for you have std::string as the return type in the hpp file and string as the return type in the cpp Doxygen may get confused and autolink to the cpp version with no documentation If you don t use the same parameter names between the cpp and hpp that will also confuse Doxygen Don t put type information in return or param documentation It doesn t really add anything and will often cause Doxygen to complain and not produce the documentation< br > use note Do not put a comma after a param name unless you mean to document multiple parameters< br/> the output stream</code >< br/> y
Angle getZenithAngle(const Position &target, AngleReduced &delta) const
static const GNSSTK_EXPORT double ONE_MM_TOLERANCE
One millimeter tolerance.
static void convertGeodeticToGeocentric(const Triple &geodeticllh, Triple &llr, const double A, const double eccSq) noexcept
double radius() const noexcept
@ Geocentric
geocentric (regular spherical coordinates)
@ Cos
Value is the cosine of the angle.
double phi() const noexcept
return spherical coordinate phi in degrees
double cos() const
Get the cosine of this angle.
static const GNSSTK_EXPORT double ONE_CM_TOLERANCE
One centimeter tolerance.
double getCurvMeridian() const noexcept
std::ostream & operator<<(std::ostream &s, const ObsEpoch &oe) noexcept
std::string asString() const
@ Spherical
spherical coordinates (theta,phi,radius)
@ WGS84
The reference frame used by GPS.
@ Deg
Value is in degrees.
Position & operator+=(const Position &right) noexcept
double deg() const
Get the angle in degrees.
CoordinateSystem
The coordinate systems supported by Position.
double cos(gnsstk::Angle x)
static const GNSSTK_EXPORT double ONE_UM_TOLERANCE
One micron tolerance.
double asDouble(const std::string &s)
T RSS(T aa, T bb, T cc)
Perform the root sum square of aa, bb and cc.
#define GNSSTK_RETHROW(exc)
static GNSSTK_EXPORT double POSITION_TOLERANCE
Default tolerance for time equality in days.
double AEarth
semi-major axis of Earth (meters)
double X() const noexcept
return X coordinate (meters)
static void convertSphericalToCartesian(const Triple &tpr, Triple &xyz) noexcept
void setValue(double v, AngleType t)
double longitude() const noexcept
Position getIonosphericPiercePoint(const double elev, const double azim, const double ionoht) const noexcept
bool operator!=(const Position &right) const noexcept
double range(const Position &A, const Position &B)
Position & setGeodetic(const double lat, const double lon, const double ht, const EllipsoidModel *ell=nullptr)
#define GNSSTK_THROW(exc)
SparseMatrix< T > operator-(const SparseMatrix< T > &L, const SparseMatrix< T > &R)
Matrix subtraction: SparseMatrix = SparseMatrix - SparseMatrix.
#define DEBUGTRACE_FUNCTION()
double elvAngle(const Triple &right) const
double theta() const noexcept
return spherical coordinate theta in degrees
bool operator==(const Position &right) const noexcept
static void convertGeodeticToCartesian(const Triple &llh, Triple &xyz, const double A, const double eccSq) noexcept
std::string formattedPrint(const std::string &fmt, const std::string &pat, const std::string &rep, T to)
Position getRayPosition(double dist, const Position &target) const
virtual double a() const noexcept=0
Position getRayPerigee(const Position &target) const
double azAngle(const Triple &right) const
double elevationGeodetic(const Position &Target) const
static void convertCartesianToSpherical(const Triple &xyz, Triple &tpr) noexcept
static void convertGeocentricToGeodetic(const Triple &llr, Triple &geodeticllh, const double A, const double eccSq) noexcept
double elevation(const Position &Target) const
std::string getSystemName() noexcept
return string giving name of coordinate system
Position & operator-=(const Position &right) noexcept
static void convertCartesianToGeocentric(const Triple &xyz, Triple &llr) noexcept
double eccSquared
square of ellipsoid eccentricity
static const double DEG_TO_RAD
Conversion Factor from degrees to radians (units: degrees^-1)
double mag() const noexcept
double getCurvPrimeVertical() const noexcept
gnsstk
Author(s):
autogenerated on Wed Oct 25 2023 02:40:40