World Ocean Simulation System (WOSS) library
woss::CoordZ Class Reference

3D-Coordinates (lat, long, depth) class definitions and functions library More...

#include <coordinates-definitions.h>

Inheritance diagram for woss::CoordZ:
Inheritance graph
Collaboration diagram for woss::CoordZ:
Collaboration graph

Classes

class  CartCoords
 Class that represents cartesian coordinates. More...
 

Public Types

enum class  CoordZSpheroidType { COORDZ_SPHERE = 0 , COORDZ_GRS80 , COORDZ_WGS84 }
 Spheroid model to use. More...
 

Public Member Functions

constexpr CoordZ (double lat=COORD_NOT_SET_VALUE, double lon=COORD_NOT_SET_VALUE, double z=COORD_NOT_SET_VALUE)
 
constexpr CoordZ (const Coord &coords, double depth=COORD_NOT_SET_VALUE)
 
constexpr CoordZ (const CoordZ &copy)=default
 
constexpr CoordZ (CoordZ &&tmp)=default
 
constexpr void setDepth (double d)
 
constexpr double getDepth () const
 
constexpr CartCoords getCartCoords (CoordZSpheroidType type=CoordZSpheroidType::COORDZ_SPHERE) const
 
constexpr double getCartX (CoordZSpheroidType type=CoordZSpheroidType::COORDZ_SPHERE) const
 
constexpr double getCartY (CoordZSpheroidType type=CoordZSpheroidType::COORDZ_SPHERE) const
 
constexpr double getCartZ (CoordZSpheroidType type=CoordZSpheroidType::COORDZ_SPHERE) const
 
constexpr double getSphericalRho () const
 
constexpr double getSphericalTheta () const
 
constexpr double getSphericalPhi () const
 
constexpr double getCartDistance (const CoordZ &coords, CoordZSpheroidType type=CoordZSpheroidType::COORDZ_SPHERE) const
 
constexpr double getCartRelZenith (const CoordZ &coords) const
 
constexpr double getCartRelAzimuth (const CoordZ &coords) const
 
constexpr bool isValid () const
 
constexpr CoordZoperator= (const CoordZ &coordz)=default
 
constexpr CoordZoperator= (CoordZ &&coordz)=default
 
- Public Member Functions inherited from woss::Coord
constexpr Coord (double lat=COORD_NOT_SET_VALUE, double lon=COORD_NOT_SET_VALUE)
 
constexpr Coord (const Coord &copy)=default
 
constexpr Coord (Coord &&tmp)=default
 
constexpr void setLatitude (double lat)
 
constexpr void setLongitude (double lon)
 
constexpr bool isValid () const
 
constexpr double getLatitude () const
 
constexpr double getLongitude () const
 
constexpr int getMarsdenSquare () const
 
constexpr int getMarsdenOneDegreeSquare () const
 
constexpr MarsdenCoord getMarsdenCoord () const
 
constexpr double getInitialBearing (const Coord &destination) const
 
constexpr double getFinalBearing (const Coord &destination) const
 
constexpr double getGreatCircleDistance (const Coord &destination, double depth=0) const
 
constexpr Coordoperator= (const Coord &copy)=default
 
constexpr Coordoperator= (Coord &&tmp)=default
 

Static Public Member Functions

static constexpr CoordZ getCoordZAlongCartLine (const CoordZ &start, const CoordZ &end, double distance)
 
static constexpr CoordZ getCoordZAlongGreatCircle (const CoordZ &start, const CoordZ &end, double distance)
 
static constexpr CoordZ getCoordZFromCartesianCoords (double x, double y, double z, CoordZSpheroidType type=CoordZSpheroidType::COORDZ_SPHERE)
 
static constexpr CoordZ getCoordZFromCartesianCoords (const CartCoords &cart_coords)
 
static constexpr CoordZ getCoordZFromSphericalCoords (double rho, double theta, double phi)
 
- Static Public Member Functions inherited from woss::Coord
static constexpr Coord getCoordFromBearing (const Coord &start_coord, double bearing, double distance, double depth=0.0)
 
static constexpr Coord getCoordAlongGreatCircle (const Coord &start_coord, const Coord &end_coord, double distance, double depth=0.0)
 
static constexpr Coord getCoordFromUtmWgs84 (double easting, double northing, double utm_zone_number, UtmZoneChar utm_zone_char)
 

Static Public Attributes

static constexpr double COORDZ_MIN_DEPTH = 0.0
 Minimum valid depth.
 
- Static Public Attributes inherited from woss::Coord
static constexpr double COORD_MIN_LATITUDE = -90.0
 Minimum valid Latitude.
 
static constexpr double COORD_MAX_LATITUDE = 90.0
 Maximum valid Latitude.
 
static constexpr double COORD_MIN_LONGITUDE = -180.0
 Minimum valid Longitude.
 
static constexpr double COORD_MAX_LONGITUDE = 180.0
 Maximum valid Longitude.
 
static constexpr double EARTH_RADIUS = 6371000.0
 Mean earth radius in meters.
 
static constexpr double EARTH_SEMIMAJOR_AXIS = 6378137.0
 Earth's semi-major axis in meters as defined by both GRS80 and WGS84.
 
static constexpr double EARTH_GRS80_POLAR_RADIUS = 6356752.3141
 Earth's semi-major axis in meters as defined by GRS80.
 
static constexpr double EARTH_WGS84_POLAR_RADIUS = 6356752.314245
 Earth's polar radius in meters as defined by WGS84.
 
static constexpr double EARTH_GRS80_ECCENTRICITY = 0.0818191910428158
 Earth's first eccentricity as defined by GRS80.
 
static constexpr double EARTH_WGS84_ECCENTRICITY = 0.0818191908426215
 Earth's first eccentricity as defined by WGS84.
 

Protected Attributes

double depth
 
- Protected Attributes inherited from woss::Coord
double latitude
 
double longitude
 
int marsden_square
 
int marsden_one_degree
 

Friends

constexpr CoordZ operator+ (const CoordZ &left, const CoordZ &right)
 
constexpr CoordZ operator- (const CoordZ &left, const CoordZ &right)
 
constexpr CoordZoperator+= (CoordZ &left, const CoordZ &right)
 
constexpr CoordZoperator-= (CoordZ &left, const CoordZ &right)
 
constexpr bool operator== (const CoordZ &left, const CoordZ &right)
 
constexpr bool operator!= (const CoordZ &left, const CoordZ &right)
 
constexpr bool operator> (const CoordZ &left, const CoordZ &right)
 
constexpr bool operator< (const CoordZ &left, const CoordZ &right)
 
constexpr bool operator>= (const CoordZ &left, const CoordZ &right)
 
constexpr bool operator<= (const CoordZ &left, const CoordZ &right)
 
std::ostream & operator<< (std::ostream &os, const CoordZ &instance)
 

Additional Inherited Members

- Protected Member Functions inherited from woss::Coord
constexpr void updateMarsdenCoord ()
 
- Static Protected Member Functions inherited from woss::Coord
static constexpr bool isValidUtmZoneChar (UtmZoneChar utm_zone_char)
 

Detailed Description

3D-Coordinates (lat, long, depth) class definitions and functions library

CoordZ class inherit from Coord, adding a depth value

Member Enumeration Documentation

◆ CoordZSpheroidType

Spheroid model to use.

Spheroid model to use: perfect sphere (CoordZSpheroidType::COORDZ_SPHERE), Geodetic Reference System 1980 (COORDZ_GRS80), or World Geodetic System 1984 (COORDZ_WGS84)

Enumerator
COORDZ_SPHERE 
COORDZ_GRS80 
COORDZ_WGS84 

Constructor & Destructor Documentation

◆ CoordZ() [1/4]

constexpr woss::CoordZ::CoordZ ( double  lat = COORD_NOT_SET_VALUE,
double  lon = COORD_NOT_SET_VALUE,
double  z = COORD_NOT_SET_VALUE 
)
inlineconstexpr

CoordZ constructor.

Parameters
latdecimal degree latitude value. Default value makes the instance not valid
londecimal degree longitude value. Default value makes the instance not valid
zdepth value in meters. Default value makes the instance not valid

◆ CoordZ() [2/4]

constexpr woss::CoordZ::CoordZ ( const Coord coords,
double  depth = COORD_NOT_SET_VALUE 
)
inlineexplicitconstexpr

Explicit CoordZ constructor. No implicit cast from Coord to CoordZ is allowed.

Parameters
coordsa Coord reference
depthdepth value in meters. Default value makes the instance not valid

◆ CoordZ() [3/4]

constexpr woss::CoordZ::CoordZ ( const CoordZ copy)
constexprdefault

◆ CoordZ() [4/4]

constexpr woss::CoordZ::CoordZ ( CoordZ &&  tmp)
constexprdefault

Member Function Documentation

◆ getCartCoords()

◆ getCartDistance()

◆ getCartRelAzimuth()

constexpr double woss::CoordZ::getCartRelAzimuth ( const CoordZ coords) const
inlineconstexpr

Gets relative azimuth from cartesian coordinates approximations, assuming earth as a sphere of ray = 6371000.0 meters

Returns
azimuth in radians

References COORDZ_SPHERE, getCartCoords(), woss::CoordZ::CartCoords::getX(), woss::CoordZ::CartCoords::getY(), and isValid().

Referenced by getCoordZAlongCartLine().

Here is the call graph for this function:

◆ getCartRelZenith()

constexpr double woss::CoordZ::getCartRelZenith ( const CoordZ coords) const
inlineconstexpr

Gets relative zenith from cartesian coordinates approximations, assuming earth as a sphere of ray = 6371000.0 meters

Returns
zenith in radians

References COORDZ_SPHERE, getCartCoords(), getCartDistance(), woss::CoordZ::CartCoords::getZ(), and isValid().

Referenced by getCoordZAlongCartLine().

Here is the call graph for this function:

◆ getCartX()

constexpr double woss::CoordZ::getCartX ( CoordZSpheroidType  type = CoordZSpheroidType::COORDZ_SPHERE) const
inlineconstexpr

Gets cartesian x coordinate

Parameters
typeEarh Model type
Returns
x in meters

References getCartCoords(), and woss::CoordZ::CartCoords::getX().

Referenced by woss::Location::getX(), WossPosition::WossPosition(), WossPosition::WossPosition(), and woss::Transducer::writeVertBeamPattern().

Here is the call graph for this function:

◆ getCartY()

constexpr double woss::CoordZ::getCartY ( CoordZSpheroidType  type = CoordZSpheroidType::COORDZ_SPHERE) const
inlineconstexpr

Gets cartesian y coordinate

Parameters
typeEarh Model type
Returns
y in meters

References getCartCoords(), and woss::CoordZ::CartCoords::getY().

Referenced by woss::Location::getY(), WossPosition::WossPosition(), WossPosition::WossPosition(), and woss::Transducer::writeVertBeamPattern().

Here is the call graph for this function:

◆ getCartZ()

constexpr double woss::CoordZ::getCartZ ( CoordZSpheroidType  type = CoordZSpheroidType::COORDZ_SPHERE) const
inlineconstexpr

Gets cartesian z coordinate

Parameters
typeEarh Model type
Returns
z in meters

References getCartCoords(), and woss::CoordZ::CartCoords::getZ().

Referenced by woss::Location::getZ(), WossPosition::WossPosition(), WossPosition::WossPosition(), and woss::Transducer::writeVertBeamPattern().

Here is the call graph for this function:

◆ getCoordZAlongCartLine()

constexpr CoordZ woss::CoordZ::getCoordZAlongCartLine ( const CoordZ start,
const CoordZ end,
double  distance 
)
staticconstexpr

Gets The CoordZ at given distance along the line in cartesian coordinates, assuming earth as a sphere of ray = 6371000.0 meters that ties start and end CoordZ

Parameters
starta const reference to a valid CoordZ object
enda const reference to a valid CoordZ object
distancetravel distance in meters
Returns
a valid CoordZ object

References COORDZ_SPHERE, depth, woss::Coord::EARTH_RADIUS, getCartCoords(), getCartRelAzimuth(), getCartRelZenith(), woss::CoordZ::CartCoords::getX(), woss::CoordZ::CartCoords::getY(), and woss::CoordZ::CartCoords::getZ().

Here is the call graph for this function:

◆ getCoordZAlongGreatCircle()

constexpr CoordZ woss::CoordZ::getCoordZAlongGreatCircle ( const CoordZ start,
const CoordZ end,
double  distance 
)
staticconstexpr

Gets The CoordZ at given distance along the great circle at starting CoordZ depth. The output depth is calculated uniformly between start and end depth that ties start and end CoordZ

Parameters
starta const reference to a valid CoordZ object
enda const reference to a valid CoordZ object
distancetravel distance in meters
Returns
a valid CoordZ object

References woss::Coord::getCoordAlongGreatCircle(), getDepth(), and woss::Coord::getGreatCircleDistance().

Referenced by WossWpPosition::WayPoint::getCurrentPosition().

Here is the call graph for this function:

◆ getCoordZFromCartesianCoords() [1/2]

constexpr CoordZ woss::CoordZ::getCoordZFromCartesianCoords ( const CartCoords cart_coords)
inlinestaticconstexpr

Gets the CoordZ converted from given cartesian coordinates

Parameters
cart_coordsconst reference to a valid CoordZ::CartCoords object
Returns
a valid CoordZ object

References getCoordZFromCartesianCoords(), woss::CoordZ::CartCoords::getType(), woss::CoordZ::CartCoords::getX(), woss::CoordZ::CartCoords::getY(), and woss::CoordZ::CartCoords::getZ().

Here is the call graph for this function:

◆ getCoordZFromCartesianCoords() [2/2]

constexpr CoordZ woss::CoordZ::getCoordZFromCartesianCoords ( double  x,
double  y,
double  z,
CoordZSpheroidType  type = CoordZSpheroidType::COORDZ_SPHERE 
)
inlinestaticconstexpr

Gets the CoordZ converted from given cartesian coordinates

Parameters
xx axis
yy axis
zz axis
typeEarth model type
Returns
a valid CoordZ object

References COORDZ_GRS80, COORDZ_SPHERE, woss::Coord::EARTH_GRS80_POLAR_RADIUS, woss::Coord::EARTH_RADIUS, woss::Coord::EARTH_SEMIMAJOR_AXIS, woss::Coord::EARTH_WGS84_POLAR_RADIUS, woss::Coord::latitude, and woss::Coord::longitude.

Referenced by WossCoordDefTest::doCoordCartTests(), and getCoordZFromCartesianCoords().

◆ getCoordZFromSphericalCoords()

constexpr CoordZ woss::CoordZ::getCoordZFromSphericalCoords ( double  rho,
double  theta,
double  phi 
)
staticconstexpr

Gets the CoordZ converted from given spherical coordinates

Parameters
rhoradius
thetatheta angle
phiphi angle
Returns
a valid CoordZ object

References woss::Coord::EARTH_RADIUS.

◆ getDepth()

◆ getSphericalPhi()

constexpr double woss::CoordZ::getSphericalPhi ( ) const
inlineconstexpr

Gets spherical phi coordinate, assuming earth as a sphere of ray = 6371000.0 meters

Returns
z in meters

References woss::Coord::longitude.

Referenced by woss::Transducer::writeVertBeamPattern().

◆ getSphericalRho()

constexpr double woss::CoordZ::getSphericalRho ( ) const
inlineconstexpr

Gets spherical rho coordinate, assuming earth as a sphere of ray = 6371000.0 meters

Returns
x in meters

References depth, and woss::Coord::EARTH_RADIUS.

◆ getSphericalTheta()

constexpr double woss::CoordZ::getSphericalTheta ( ) const
inlineconstexpr

Gets spherical theta coordinate, assuming earth as a sphere of ray = 6371000.0 meters

Returns
y in meters

References woss::Coord::latitude.

Referenced by woss::Transducer::writeVertBeamPattern().

◆ isValid()

constexpr bool woss::CoordZ::isValid ( ) const
inlineconstexpr

◆ operator=() [1/2]

constexpr CoordZ & woss::CoordZ::operator= ( const CoordZ coordz)
constexprdefault

Assignment operator

Parameters
copyconst reference to a CoordZ object to be copied
Returns
CoordZ reference to this

◆ operator=() [2/2]

constexpr CoordZ & woss::CoordZ::operator= ( CoordZ &&  coordz)
constexprdefault

Move assignment operator

Parameters
copyrvalue reference to a CoordZ object to be moved
Returns
CoordZ reference to this

◆ setDepth()

constexpr void woss::CoordZ::setDepth ( double  d)
inlineconstexpr

Sets depth

Parameters
ddepth in meters

References depth.

Referenced by woss::ACToolboxWoss::initAltimetry(), woss::ACToolboxWoss::initCoordZVector(), and woss::Location::setDepth().

Friends And Related Symbol Documentation

◆ operator!=

constexpr bool operator!= ( const CoordZ left,
const CoordZ right 
)
friend

Inequality operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
true if left != right, false otherwise

◆ operator+

constexpr CoordZ operator+ ( const CoordZ left,
const CoordZ right 
)
friend

Sum operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
a new const instance holding the operation result

◆ operator+=

constexpr CoordZ & operator+= ( CoordZ left,
const CoordZ right 
)
friend

Compound assignment sum operator

Parameters
leftleft operand reference
rightright operand const reference
Returns
left reference after the operation

◆ operator-

constexpr CoordZ operator- ( const CoordZ left,
const CoordZ right 
)
friend

Subtraction operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
a new const instance holding the operation result

◆ operator-=

constexpr CoordZ & operator-= ( CoordZ left,
const CoordZ right 
)
friend

Compound assignment subtraction operator

Parameters
leftleft operand reference
rightright operand const reference
Returns
left reference after the operation

◆ operator<

constexpr bool operator< ( const CoordZ left,
const CoordZ right 
)
friend

Less than operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
true if left < right, false otherwise

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const CoordZ instance 
)
friend

<< operator

Parameters
osleft operand ostream reference
instanceright operand const CoordZ reference
Returns
os reference after the operation

◆ operator<=

constexpr bool operator<= ( const CoordZ left,
const CoordZ right 
)
friend

Less than or equal to operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
true if left <= right, false otherwise

◆ operator==

constexpr bool operator== ( const CoordZ left,
const CoordZ right 
)
friend

Equality operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
true if left == right, false otherwise

◆ operator>

constexpr bool operator> ( const CoordZ left,
const CoordZ right 
)
friend

Greater than operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
true if left > right, false otherwise

◆ operator>=

constexpr bool operator>= ( const CoordZ left,
const CoordZ right 
)
friend

Greater than or equal to operator

Parameters
leftleft operand const reference
rightright operand const reference
Returns
true if left >= right, false otherwise

Member Data Documentation

◆ COORDZ_MIN_DEPTH

constexpr double woss::CoordZ::COORDZ_MIN_DEPTH = 0.0
staticconstexpr

Minimum valid depth.

Referenced by isValid().

◆ depth

double woss::CoordZ::depth
protected

The documentation for this class was generated from the following file: