33#ifndef WOSS_COORDINATES_DEFINITIONS_H
34#define WOSS_COORDINATES_DEFINITIONS_H
90 static constexpr inline double COORD_NOT_SET_VALUE = -2000.0;
132 constexpr Coord(
double lat = COORD_NOT_SET_VALUE,
double lon = COORD_NOT_SET_VALUE );
341 friend std::ostream&
operator<<( std::ostream& os,
const Coord& instance );
430 constexpr double getX()
const {
return x; }
436 constexpr double getY()
const {
return y; }
442 constexpr double getZ()
const {
return z; }
475 constexpr CoordZ(
double lat = COORD_NOT_SET_VALUE,
double lon = COORD_NOT_SET_VALUE,
double z = COORD_NOT_SET_VALUE );
482 explicit constexpr CoordZ(
const Coord& coords,
double depth = COORD_NOT_SET_VALUE );
718 friend std::ostream&
operator<<( std::ostream& os,
const CoordZ& instance );
738 constexpr UtmWgs84(
int utmZone = COORD_NOT_SET_VALUE,
double east = COORD_NOT_SET_VALUE,
double north = COORD_NOT_SET_VALUE);
746 constexpr bool isValid()
const;
782 template <
class CompUser,
class T = Coord >
796 if ( CompUser::getSpaceSampling() <= 0.0 )
798 if ( x.getGreatCircleDistance(y) <= CompUser::getSpaceSampling() )
813 template <
class CompUser >
827 if ( CompUser::getSpaceSampling() <= 0.0 )
842 marsden_square(COORD_NOT_SET_VALUE),
843 marsden_one_degree(COORD_NOT_SET_VALUE)
859 marsden_one_degree =(int)( (std::floor(std::abs(lat)) - std::floor(std::abs(lat)/10.0)*10.0)*10.0 + (std::floor(std::abs(lon)) - std::floor(std::abs(lon)/10.0)*10.0));
861 if (( lat >= 0.0) && (lat < 80.0) ) {
865 int quoz_lat = (int)std::floor(lat / 10.0);
866 int quoz_long = (int)std::ceil(lon / 10.0);
868 double rem_lon = std::fmod(lon, 10.0);
874 else if (lat >= 80.0) {
878 int quoz_long = (int)std::ceil(lon / 10.0);
880 double rem_lon = std::fmod(lon, 10.0);
890 int quoz_lat = (int)std::floor(lat / 10.0);
891 int quoz_long = (int)std::floor(lon / 10.0);
894 double rem_lat = std::fmod(lat, 10.0);
904 assert( destination.
isValid() );
906 double lat1 = destination.
latitude * M_PI / 180.0;
907 double lon1 = destination.
longitude * M_PI / 180.0;
908 double lat2 = std::asin( std::sin(lat1) * std::cos(distance/(
EARTH_RADIUS-depth))
909 + std::cos(lat1) * std::sin(distance/(
EARTH_RADIUS-depth)) * std::cos(bearing) );
910 double lon2 = lon1 + std::atan2(std::sin(bearing) * std::sin(distance/(
EARTH_RADIUS-depth)) * std::cos(lat1),
911 std::cos(distance/(
EARTH_RADIUS-depth)) - std::sin(lat1) * std::sin(lat2));
913 double ret_lat = lat2 * 180.0 / M_PI;
914 double ret_long = lon2 * 180.0 / M_PI;
916 ret_long = std::fmod((ret_long + 540.0), 360.0) - 180.0;
921 return(
Coord(ret_lat, ret_long) );
926 assert( destination.
isValid() );
928 double lat1 =
latitude * M_PI / 180.0;
929 double lat2 = destination.
latitude * M_PI / 180.0;
932 double y = std::sin(dLon) * std::cos(lat2);
933 double x = std::cos(lat1)* std::sin(lat2) - std::sin(lat1)* std::cos(lat2) * std::cos(dLon);
935 double bearing = std::atan2(y, x);
937 bearing += 2.0 * M_PI;
938 bearing = std::fmod(bearing, 2.0 * M_PI);
947 double fin_bear = init_bear + M_PI;
948 fin_bear = std::fmod(fin_bear, 2.0 * M_PI);
955 assert( destination.
isValid() );
959 double lat1 =
latitude * M_PI / 180.0;
960 double lat2 = destination.
latitude * M_PI / 180.0;
962 double a = std::sin(dLat/2.0) * std::sin(dLat/2.0) +
963 std::cos(lat1) * std::cos(lat2) *
964 std::sin(dLon/2.0) * std::sin(dLon/2.0);
966 double c = 2.0 * std::atan2(std::sqrt(a), std::sqrt(1.0-a));
973 if ( ( (utm_zone_char >=
'C') && ( utm_zone_char <=
'X' ) && (utm_zone_char !=
'I')
974 && (utm_zone_char !=
'O') )
975 || ( (utm_zone_char >=
'c') && ( utm_zone_char <=
'x' ) && (utm_zone_char !=
'i')
976 && (utm_zone_char !=
'o') ) )
985 std::cerr <<
"Coord::getCoordFromUtmWgs84() easting = " << easting <<
"; northing = " << northing
986 <<
"; utm zone = " << utm_zone_number <<
"; utm zone char = " << utm_zone_char
987 <<
"; WARNING, invalid input parameters!!" << std::endl;
990 std::cout <<
"Coord::getCoordFromUtmWgs84() easting = " << easting <<
"; northing = " << northing
991 <<
"; utm zone = " << utm_zone_number <<
"; utm zone char = " << utm_zone_char
992 <<
"; zone int = " << (
unsigned int) utm_zone_char <<
"; c = " << (
unsigned int)
'c'
993 <<
"; m = " << (
unsigned int)
'm' <<
"; C = " << (
unsigned int)
'C' <<
"; M = "
994 << (
unsigned int)
'M' << std::endl;
996 bool is_hemis_north =
true;
998 if ( ((utm_zone_char <
'M') && (utm_zone_char >=
'C'))
999 || ((utm_zone_char <
'm') && (utm_zone_char >=
'c')) ) {
1000 is_hemis_north =
false;
1008 double e2 = std::pow( ( std::pow(sa, 2.0) - std::pow(sb, 2.0) ), 0.5 ) / sb;
1009 double e2square = std::pow( e2, 2.0);
1010 double c = std::pow( sa, 2.0 ) / sb;
1013 double X = easting - 500000.0;
1018 if ( is_hemis_north ==
false )
1019 Y = northing - 10000000.0;
1024 double S = ( ( utm_zone_number * 6.0 ) - 183.0 );
1025 double lat = Y / ( 6366197.724 * 0.9996 ) ;
1027 double v = ( c / std::pow( ( 1.0 + ( e2square * std::pow( std::cos(lat), 2.0 ) ) ), 0.5 ) ) * 0.9996;
1031 double a1 = std::sin( 2.0 * lat ) ;
1032 double a2 = a1 * std::pow( std::cos(lat), 2.0);
1034 double j2 = lat + a1/2.0 ;
1035 double j4 = ( 3.0 * j2 + a2 ) / 4.0 ;
1036 double j6 = ( 5.0 * j4 + a2 * std::pow( std::cos(lat), 2.0 ) ) / 3.0;
1038 double alpha = 3.0/4.0 * e2square ;
1039 double beta = 5.0/3.0 * std::pow( alpha, 2.0 );
1040 double gamma = 35.0/27.0 * std::pow( alpha, 3.0 );
1042 double Bm = 0.9996 * c * ( lat - alpha * j2 + beta * j4 - gamma * j6 );
1043 double b = ( Y - Bm ) / v ;
1044 double Epsi = e2square * std::pow( a, 2.0 ) / 2.0 * std::pow( std::cos(lat), 2.0 );
1045 double Epss = a * ( 1.0 - Epsi / 3.0 );
1046 double nab = b * ( 1.0 - Epsi ) + lat;
1048 double Delt = std::atan( std::sinh(Epss) / std::cos(nab) );
1049 double TaO = std::atan( std::cos(Delt) * std::tan(nab) );
1051 double longitude = Delt * 180.0 / M_PI + S;
1052 double latitude = ( lat + ( 1.0 + e2square * std::pow( std::cos(lat), 2.0 ) - 3.0/2.0 * e2square * std::sin(lat) * std::cos(lat) * ( TaO - lat ) ) * ( TaO - lat ) ) * 180.0 / M_PI;
1055 std::cout <<
"Coord::getCoordFromUtmWgs84() latitude = " <<
latitude
1056 <<
"; longitude = " <<
longitude << std::endl;
1101 double latitudeRadians = M_PI / 180.0 *
latitude;
1102 double longitudeRadians = M_PI / 180.0 *
longitude;
1105 double altitude = -1.0 *
depth;
1121 double Rn = a / (std::sqrt(1.0 - std::pow(e, 2.0) * std::pow(std::sin(latitudeRadians), 2.0)));
1122 double x = (Rn + altitude) * std::cos(latitudeRadians) * std::cos(longitudeRadians);
1123 double y = (Rn + altitude) * std::cos(latitudeRadians) * std::sin(longitudeRadians);
1124 double z = ((1 - std::pow (e, 2.0)) * Rn + altitude) * std::sin(latitudeRadians);
1165 return std::sqrt( std::pow((my_cart_coords.
getX() - input_cart_coords.
getX()), 2.0)
1166 + std::pow((my_cart_coords.
getY() - input_cart_coords.
getY()), 2.0)
1167 + std::pow((my_cart_coords.
getZ() - input_cart_coords.
getZ()), 2.0));
1177 return(std::atan2((input_cart_coords.
getY() - my_cart_coords.
getY()), (input_cart_coords.
getX() - my_cart_coords.
getX())));
1193 left.
latitude = COORD_NOT_SET_VALUE;
1204 left.
latitude = COORD_NOT_SET_VALUE;
1228 if ( &left == &right )
1235 if ( &left == &right )
1242 if ( &left == &right )
1249 if ( &left == &right )
1256 if ( left == right )
1258 return( left > right );
1263 if ( left == right )
1265 return( left < right );
1278 os <<
"X = " << instance.
x <<
"; Y = " << instance.
y <<
"; Z = " << instance.
z <<
"; type = " <<
static_cast<int>(instance.
type);
1284 if ( &left == &right )
1291 if ( &left == &right )
1298 if ( &left == &right )
1307 if ( &left == &right )
1315 if ( left == right )
1317 return( left > right );
1322 if ( left == right )
1324 return( left < right );
1330 left.
latitude = COORD_NOT_SET_VALUE;
1332 left.
depth = COORD_NOT_SET_VALUE;
1342 left.
latitude = COORD_NOT_SET_VALUE;
1344 left.
depth = COORD_NOT_SET_VALUE;
1353 os <<
"Latitude = " << instance.
latitude <<
"; Longitude = " << instance.
longitude <<
"; Depth = " << instance.
depth
1360 double start_depth = start.
getDepth();
1364 if ( total_distance == 0.0 && start_depth != end_depth ) {
1365 total_distance = std::abs(end_depth - start_depth);
1366 assert( distance < total_distance );
1368 return(
CoordZ(
static_cast<Coord>(start), distance ) );
1371 double delta_depth = end_depth - start_depth;
1372 double curr_depth = start_depth + distance / total_distance * delta_depth;
1379 double Xsorg_ = sorg_cart_coords.
getX();
1380 double Ysorg_ = sorg_cart_coords.
getY();
1381 double Zsorg_ = sorg_cart_coords.
getZ();
1386 double x_fin = Xsorg_ + distance * std::cos(azimut) * std::sin(polar);
1387 double y_fin = Ysorg_ + distance * std::sin(azimut) * std::sin(polar);
1388 double z_fin = Zsorg_ + distance * std::cos(polar);
1392 double Xdest_ = end_cart_coords.
getX();
1393 double Ydest_ = end_cart_coords.
getY();
1394 double Zdest_ = end_cart_coords.
getZ();
1396 std::cout << std::endl;
1397 std::cout <<
"x_fin = " << x_fin <<
"; Xdest_ = " << Xdest_ <<
"; diff = " << (x_fin - Xdest_) << std::endl;
1398 std::cout <<
"y_fin = " << y_fin <<
"; Ydest_ = " << Ydest_ <<
"; diff = " << (y_fin - Ydest_) << std::endl;
1399 std::cout <<
"z_fin = " << z_fin <<
"; Zdest_ = " << Zdest_ <<
"; diff = " << (z_fin - Zdest_) << std::endl;
1401 std::cout << std::endl;
1402 std::cout <<
"x_fin = " << x_fin <<
"; Xsorg_ = " << Xsorg_ <<
"; diff = " << (x_fin - Xsorg_) << std::endl;
1403 std::cout <<
"y_fin = " << y_fin <<
"; Ysorg_ = " << Ysorg_ <<
"; diff = " << (y_fin - Ysorg_) << std::endl;
1404 std::cout <<
"z_fin = " << z_fin <<
"; Zsorg_ = " << Zsorg_ <<
"; diff = " << (z_fin - Zsorg_) << std::endl;
1406 std::cout << std::endl;
1407 std::cout <<
"Xdest_ = " << Xdest_ <<
"; Xsorg_ = " << Xsorg_ <<
"; diff = " << (Xdest_ - Xsorg_) << std::endl;
1408 std::cout <<
"Ydest_ = " << Ydest_ <<
"; Ysorg_ = " << Ysorg_ <<
"; diff = " << (Ydest_ - Ysorg_) << std::endl;
1409 std::cout <<
"Zdest_ = " << Zdest_ <<
"; Zsorg_ = " << Zsorg_ <<
"; diff = " << (Zdest_ - Zsorg_) << std::endl;
1412 double lat = 90.0 - 180.0 / M_PI * acos( z_fin / std::sqrt( std::pow(x_fin,2.0) + std::pow(y_fin,2.0) + std::pow(z_fin,2.0) ) );
1413 double lon = 180.0 / M_PI * std::atan2( y_fin, x_fin );
1414 double depth = std::sqrt( std::pow(x_fin,2.0) + std::pow(y_fin,2.0) + std::pow(z_fin,2.0) ) -
EARTH_RADIUS;
1417 std::cout <<
"lat = " << lat << std::endl;
1418 std::cout <<
"long = " << lon << std::endl;
1419 std::cout <<
"depth = " <<
depth << std::endl;
1430 double polarRadius = 0.0;
1431 double equatorRadius = 0.0;
1432 double e2Param = 0.0;
1441 e2Param = ( std::pow(equatorRadius, 2.0) - std::pow(polarRadius, 2.0) ) / std::pow(equatorRadius, 2.0);
1446 e2Param = ( std::pow(equatorRadius, 2.0) - std::pow(polarRadius, 2.0) ) / std::pow(equatorRadius, 2.0);
1449 double latitude = COORD_NOT_SET_VALUE;
1451 double altitude = COORD_NOT_SET_VALUE;
1454 double op = std::sqrt( x*x + y*y + z*z );
1458 double lon2 = std::atan(y / x);
1461 if ( x != 0.0 || y != 0.0 ) {
1462 longitude = std::atan(y/x) * 180.0/M_PI;
1477 double latG = std::atan(z / (std::sqrt( x*x + y*y )));
1480 double latQ = std::atan(z / ( (1.0 - e2Param ) * (std::sqrt( x*x + y*y ))) );
1483 double rCurvature = ( equatorRadius / std::sqrt(1.0 - e2Param * std::sin(latQ) * std::sin(latQ)) );
1486 double xQ = rCurvature * std::cos(latQ) * std::cos(lon2);
1487 double yQ = rCurvature * std::cos(latQ) * std::sin(lon2);
1488 double zQ = rCurvature * (1.0 - e2Param) * std::sin(latQ);
1491 double oq = std::sqrt( xQ*xQ + yQ*yQ + zQ*zQ );
1494 double pq = op - oq;
1498 double tp = pq * std::sin(latG - latQ);
1500 double lat_radians = latQ + tp / op * std::cos(latQ - latG);
1503 altitude = pq * std::cos(latQ - latG);
1505 std::cout <<
"lat new = " <<
latitude << std::endl;
1506 std::cout <<
"lon new = " <<
longitude << std::endl;
1507 std::cout <<
"alt new = " << altitude << std::endl;
1546 return ((zone != COORD_NOT_SET_VALUE) && (easting != COORD_NOT_SET_VALUE) && (northing != COORD_NOT_SET_VALUE));
1550 os <<
"Zone = " << instance.
zone <<
"; Easting = " << instance.
easting <<
"; Northing = " << instance.
northing;
1565 double falseEasting = 500000.0;
1566 double falseNorthing = 10000000.0;
1568 int zone = std::floor((longitude + 180.0)/6.0) + 1;
1569 double lambda0 = ((
zone-1)*6.0 - 180.0 + 3.0)*M_PI / 180.0;
1570 double phi = latitude*M_PI/180.0;
1571 double lambda = longitude*M_PI/180.0 - lambda0;
1574 double f = 1/298.2572215381486;
1578 double e = std::sqrt(f*(2.0-f));
1579 double n = f/(2.0-f);
1580 double n2 = std::pow(n,2.0);
1581 double n3 = std::pow(n,3.0);
1582 double n4 = std::pow(n,4.0);
1583 double n5 = std::pow(n,5.0);
1584 double n6 = std::pow(n,6.0);
1586 double cosLambda = std::cos(lambda);
1587 double sinLambda = std::sin(lambda);
1589 double tau = std::tan(phi);
1590 double sigma = std::sinh(e*atanh(e*tau / std::sqrt(1.0+std::pow(tau,2.0)) ));
1592 double tau_prime = tau*std::sqrt(1.0 + std::pow(sigma,2.0)) - sigma*std::sqrt(1.0 + std::pow(tau,2.0));
1594 double epsilon_prime = std::atan2(tau_prime, cosLambda);
1595 double eta_prime = std::asinh(sinLambda/ std::sqrt( std::pow(tau_prime,2.0) + std::pow(cosLambda,2.0)));
1597 double A = a/(1.0+n) * (1.0 + 1.0/4.0*n2 + 1.0/64.0*n4 + 1.0/256.0*n6);
1598 double alpha[] = {0.0,
1599 1.0/2.0*n - 2.0/3.0*n2 + 5.0/16.0*n3 + 41.0/180.0*n4 -127.0/288.0*n5 + 7891.0/37800.0*n6,
1600 13.0/48.0*n2 - 3.0/5.0*n3 + 557.0/1440.0*n4 + 281.0/630.0*n5 - 1983433.0/1935360.0*n6,
1601 61.0/240.0*n3 - 103.0/140.0*n4 + 15061.0/26880.0*n5 + 167603.0/181440.0*n6,
1602 49561.0/161280.0*n4 - 179.0/168*n5 + 6601661.0/7257600.0*n6,
1603 34729.0/80640.0*n5 - 3418889.0/1995840.0*n6,
1604 212378941.0/319334400.0*n6};
1605 double epsilon = epsilon_prime;
1607 for(
int j = 1; j<=6; j++) {
1608 epsilon += alpha[j]*std::sin(2.0*j*epsilon_prime)*std::cosh(2.0*j*eta_prime);
1611 double eta = eta_prime;
1612 for(
int j = 1; j<=6; j++) {
1613 eta += alpha[j]*std::cos(2.0*j*epsilon_prime)*std::sinh(2.0*j*eta_prime);
1616 double x = k0*A*eta;
1617 double y = k0*A*epsilon;
1619 x = x + falseEasting;
1622 y = y + falseNorthing;
bool operator()(const CoordZ &x, const CoordZ &y) const
Definition coordinates-definitions.h:826
Function object for partial ordering of coordinates.
Definition coordinates-definitions.h:783
bool operator()(const T &x, const T &y) const
Definition coordinates-definitions.h:795
Class that represents cartesian coordinates.
Definition coordinates-definitions.h:409
double x
Definition coordinates-definitions.h:460
constexpr double getY() const
Definition coordinates-definitions.h:436
double z
Y-asis value in meters.
Definition coordinates-definitions.h:464
constexpr double getX() const
Definition coordinates-definitions.h:430
CoordZSpheroidType type
Z-asis value in meters.
Definition coordinates-definitions.h:466
double y
X-asis value in meters.
Definition coordinates-definitions.h:462
friend std::ostream & operator<<(std::ostream &os, const CartCoords &instance)
Definition coordinates-definitions.h:1277
constexpr CoordZSpheroidType getType() const
Definition coordinates-definitions.h:448
constexpr double getZ() const
Definition coordinates-definitions.h:442
constexpr CartCoords()
Definition coordinates-definitions.h:1083
3D-Coordinates (lat, long, depth) class definitions and functions library
Definition coordinates-definitions.h:384
constexpr bool isValid() const
Definition coordinates-definitions.h:616
constexpr double getSphericalTheta() const
Definition coordinates-definitions.h:1149
friend constexpr CoordZ & operator+=(CoordZ &left, const CoordZ &right)
Definition coordinates-definitions.h:1328
constexpr CoordZ(CoordZ &&tmp)=default
static constexpr CoordZ getCoordZFromCartesianCoords(double x, double y, double z, CoordZSpheroidType type=CoordZSpheroidType::COORDZ_SPHERE)
Definition coordinates-definitions.h:1429
friend constexpr bool operator>=(const CoordZ &left, const CoordZ &right)
Definition coordinates-definitions.h:1314
friend std::ostream & operator<<(std::ostream &os, const CoordZ &instance)
Definition coordinates-definitions.h:1352
friend constexpr bool operator==(const CoordZ &left, const CoordZ &right)
Definition coordinates-definitions.h:1283
static constexpr CoordZ getCoordZAlongGreatCircle(const CoordZ &start, const CoordZ &end, double distance)
Definition coordinates-definitions.h:1359
constexpr double getCartX(CoordZSpheroidType type=CoordZSpheroidType::COORDZ_SPHERE) const
Definition coordinates-definitions.h:1129
constexpr double getCartZ(CoordZSpheroidType type=CoordZSpheroidType::COORDZ_SPHERE) const
Definition coordinates-definitions.h:1139
constexpr double getCartDistance(const CoordZ &coords, CoordZSpheroidType type=CoordZSpheroidType::COORDZ_SPHERE) const
Definition coordinates-definitions.h:1159
constexpr CoordZ(const CoordZ ©)=default
constexpr double getSphericalPhi() const
Definition coordinates-definitions.h:1154
constexpr double getSphericalRho() const
Definition coordinates-definitions.h:1144
friend constexpr CoordZ operator+(const CoordZ &left, const CoordZ &right)
Definition coordinates-definitions.h:1521
constexpr void setDepth(double d)
Definition coordinates-definitions.h:492
constexpr CoordZ & operator=(const CoordZ &coordz)=default
CoordZSpheroidType
Spheroid model to use.
Definition coordinates-definitions.h:398
constexpr CoordZ(double lat=COORD_NOT_SET_VALUE, double lon=COORD_NOT_SET_VALUE, double z=COORD_NOT_SET_VALUE)
Definition coordinates-definitions.h:1067
constexpr CoordZ & operator=(CoordZ &&coordz)=default
friend constexpr bool operator!=(const CoordZ &left, const CoordZ &right)
Definition coordinates-definitions.h:1290
constexpr double getCartRelZenith(const CoordZ &coords) const
Definition coordinates-definitions.h:1181
static constexpr CoordZ getCoordZFromSphericalCoords(double rho, double theta, double phi)
Definition coordinates-definitions.h:1514
friend constexpr CoordZ operator-(const CoordZ &left, const CoordZ &right)
Definition coordinates-definitions.h:1527
constexpr double getCartY(CoordZSpheroidType type=CoordZSpheroidType::COORDZ_SPHERE) const
Definition coordinates-definitions.h:1134
friend constexpr bool operator<(const CoordZ &left, const CoordZ &right)
Definition coordinates-definitions.h:1306
constexpr double getDepth() const
Definition coordinates-definitions.h:498
friend constexpr bool operator<=(const CoordZ &left, const CoordZ &right)
Definition coordinates-definitions.h:1321
friend constexpr CoordZ & operator-=(CoordZ &left, const CoordZ &right)
Definition coordinates-definitions.h:1340
double depth
Definition coordinates-definitions.h:725
constexpr double getCartRelAzimuth(const CoordZ &coords) const
Definition coordinates-definitions.h:1171
constexpr CartCoords getCartCoords(CoordZSpheroidType type=CoordZSpheroidType::COORDZ_SPHERE) const
Definition coordinates-definitions.h:1100
static constexpr CoordZ getCoordZAlongCartLine(const CoordZ &start, const CoordZ &end, double distance)
Definition coordinates-definitions.h:1377
static constexpr double COORDZ_MIN_DEPTH
Minimum valid depth.
Definition coordinates-definitions.h:388
friend constexpr bool operator>(const CoordZ &left, const CoordZ &right)
Definition coordinates-definitions.h:1297
Coordinates (lat, long) class definitions and functions library.
Definition coordinates-definitions.h:98
static constexpr double COORD_MAX_LATITUDE
Maximum valid Latitude.
Definition coordinates-definitions.h:104
constexpr double getInitialBearing(const Coord &destination) const
Definition coordinates-definitions.h:925
friend constexpr bool operator<=(const Coord &left, const Coord &right)
Definition coordinates-definitions.h:1262
static constexpr double EARTH_GRS80_ECCENTRICITY
Earth's first eccentricity as defined by GRS80.
Definition coordinates-definitions.h:122
static constexpr double EARTH_GRS80_POLAR_RADIUS
Earth's semi-major axis in meters as defined by GRS80.
Definition coordinates-definitions.h:116
constexpr void setLongitude(double lon)
Definition coordinates-definitions.h:148
constexpr int getMarsdenOneDegreeSquare() const
Definition coordinates-definitions.h:179
constexpr int getMarsdenSquare() const
Definition coordinates-definitions.h:173
static constexpr double COORD_MAX_LONGITUDE
Maximum valid Longitude.
Definition coordinates-definitions.h:108
friend constexpr bool operator!=(const Coord &left, const Coord &right)
Definition coordinates-definitions.h:1234
constexpr double getGreatCircleDistance(const Coord &destination, double depth=0) const
Definition coordinates-definitions.h:954
static constexpr double EARTH_WGS84_ECCENTRICITY
Earth's first eccentricity as defined by WGS84.
Definition coordinates-definitions.h:125
constexpr void setLatitude(double lat)
Definition coordinates-definitions.h:142
friend constexpr Coord operator+(const Coord &left, const Coord &right)
Definition coordinates-definitions.h:1213
friend constexpr bool operator<(const Coord &left, const Coord &right)
Definition coordinates-definitions.h:1248
friend constexpr Coord operator-(const Coord &left, const Coord &right)
Definition coordinates-definitions.h:1220
constexpr Coord & operator=(const Coord ©)=default
double latitude
Definition coordinates-definitions.h:348
static constexpr double COORD_MIN_LATITUDE
Minimum valid Latitude.
Definition coordinates-definitions.h:102
friend constexpr Coord & operator-=(Coord &left, const Coord &right)
Definition coordinates-definitions.h:1202
constexpr Coord(Coord &&tmp)=default
static constexpr Coord getCoordFromBearing(const Coord &start_coord, double bearing, double distance, double depth=0.0)
Definition coordinates-definitions.h:903
constexpr Coord(const Coord ©)=default
double longitude
Definition coordinates-definitions.h:353
constexpr bool isValid() const
Definition coordinates-definitions.h:154
constexpr double getFinalBearing(const Coord &destination) const
Definition coordinates-definitions.h:944
friend constexpr bool operator>(const Coord &left, const Coord &right)
Definition coordinates-definitions.h:1241
constexpr void updateMarsdenCoord()
Definition coordinates-definitions.h:849
static constexpr double EARTH_RADIUS
Mean earth radius in meters.
Definition coordinates-definitions.h:110
static constexpr double EARTH_SEMIMAJOR_AXIS
Earth's semi-major axis in meters as defined by both GRS80 and WGS84.
Definition coordinates-definitions.h:113
friend constexpr bool operator==(const Coord &left, const Coord &right)
Definition coordinates-definitions.h:1227
static constexpr bool isValidUtmZoneChar(UtmZoneChar utm_zone_char)
Definition coordinates-definitions.h:972
friend constexpr Coord & operator+=(Coord &left, const Coord &right)
Definition coordinates-definitions.h:1191
static constexpr Coord getCoordFromUtmWgs84(double easting, double northing, double utm_zone_number, UtmZoneChar utm_zone_char)
Definition coordinates-definitions.h:983
static constexpr double EARTH_WGS84_POLAR_RADIUS
Earth's polar radius in meters as defined by WGS84.
Definition coordinates-definitions.h:119
int marsden_one_degree
Definition coordinates-definitions.h:363
constexpr MarsdenCoord getMarsdenCoord() const
Definition coordinates-definitions.h:185
int marsden_square
Definition coordinates-definitions.h:358
friend constexpr bool operator>=(const Coord &left, const Coord &right)
Definition coordinates-definitions.h:1255
constexpr Coord(double lat=COORD_NOT_SET_VALUE, double lon=COORD_NOT_SET_VALUE)
Definition coordinates-definitions.h:839
constexpr Coord & operator=(Coord &&tmp)=default
static constexpr double COORD_MIN_LONGITUDE
Minimum valid Longitude.
Definition coordinates-definitions.h:106
friend std::ostream & operator<<(std::ostream &os, const Coord &instance)
Definition coordinates-definitions.h:1269
constexpr double getLongitude() const
Definition coordinates-definitions.h:167
static constexpr Coord getCoordAlongGreatCircle(const Coord &start_coord, const Coord &end_coord, double distance, double depth=0.0)
Definition coordinates-definitions.h:1062
constexpr double getLatitude() const
Definition coordinates-definitions.h:161
Definition coordinates-definitions.h:728
constexpr UtmWgs84(int utmZone=COORD_NOT_SET_VALUE, double east=COORD_NOT_SET_VALUE, double north=COORD_NOT_SET_VALUE)
Definition coordinates-definitions.h:1555
constexpr double getNorthing() const
Definition coordinates-definitions.h:1541
double northing
Definition coordinates-definitions.h:771
constexpr int getZone() const
Definition coordinates-definitions.h:1533
static constexpr UtmWgs84 getUtmWgs84FromCoord(const Coord &coords)
Definition coordinates-definitions.h:1562
constexpr double getEasting() const
Definition coordinates-definitions.h:1537
int zone
Definition coordinates-definitions.h:767
friend std::ostream & operator<<(std::ostream &os, const UtmWgs84 &instance)
Definition coordinates-definitions.h:1549
constexpr bool isValid() const
Definition coordinates-definitions.h:1545
double easting
Definition coordinates-definitions.h:769
Definition ac-toolbox-arr-asc-reader.h:44
std::pair< int, int > MarsdenCoord
Definition coordinates-definitions.h:70
constexpr bool operator<(const Coord &left, const Coord &right)
Definition coordinates-definitions.h:1248
std::vector< Coord > CoordVector
Definition coordinates-definitions.h:75
std::vector< CoordZ > CoordZVector
Definition coordinates-definitions.h:58
std::vector< MarsdenCoord > MarsdenCoordVector
Definition coordinates-definitions.h:85
char UtmZoneChar
Definition coordinates-definitions.h:52
int Marsden
Definition coordinates-definitions.h:63
std::vector< Marsden > MarsdenVector
Definition coordinates-definitions.h:80