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  CoordZSpheroidType { COORDZ_SPHERE = 0 , COORDZ_GRS80 , COORDZ_WGS84 }
 Spheroid model to use. More...
 

Public Member Functions

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

Static Public Member Functions

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

Static Public Attributes

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

const CoordZ operator+ (const CoordZ &left, const CoordZ &right)
 
const CoordZ operator- (const CoordZ &left, const CoordZ &right)
 
CoordZoperator+= (CoordZ &left, const CoordZ &right)
 
CoordZoperator-= (CoordZ &left, const CoordZ &right)
 
bool operator== (const CoordZ &left, const CoordZ &right)
 
bool operator!= (const CoordZ &left, const CoordZ &right)
 
bool operator> (const CoordZ &left, const CoordZ &right)
 
bool operator< (const CoordZ &left, const CoordZ &right)
 
bool operator>= (const CoordZ &left, const CoordZ &right)
 
bool operator<= (const CoordZ &left, const CoordZ &right)
 

Additional Inherited Members

- Protected Member Functions inherited from woss::Coord
void updateMarsdenCoord ()
 
- Static Protected Member Functions inherited from woss::Coord
static 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 (COORDZ_SPHERE), Geodetic Reference System 1980 (COORDZ_GRS80), or World Geodetic System 1984 (COORDZ_WGS84)

Constructor & Destructor Documentation

◆ CoordZ() [1/3]

CoordZ::CoordZ ( double  lat = COORD_NOT_SET_VALUE,
double  lon = COORD_NOT_SET_VALUE,
double  z = COORD_NOT_SET_VALUE 
)

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

Referenced by getCoordZAlongCartLine(), getCoordZAlongGreatCircle(), getCoordZFromCartesianCoords(), and getCoordZFromSphericalCoords().

◆ CoordZ() [2/3]

CoordZ::CoordZ ( const Coord coords,
double  depth = COORD_NOT_SET_VALUE 
)
explicit

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/3]

CoordZ::CoordZ ( const CoordZ copy)

CoordZ copy constructor.

Parameters
copyconst reference to a CoordZ to be copied

Member Function Documentation

◆ getCartCoords()

◆ getCartDistance()

◆ getCartRelAzimuth()

double CoordZ::getCartRelAzimuth ( const CoordZ coords) const

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

Returns
azimuth in radians

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

Referenced by getCoordZAlongCartLine().

Here is the call graph for this function:

◆ getCartRelZenith()

double CoordZ::getCartRelZenith ( const CoordZ coords) const

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

Returns
zenith in radians

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

Referenced by getCoordZAlongCartLine().

Here is the call graph for this function:

◆ getCartX()

double CoordZ::getCartX ( CoordZSpheroidType  type = COORDZ_SPHERE) const

Gets cartesian x coordinate

Parameters
typeEarh Model type
Returns
x in meters

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

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

Here is the call graph for this function:

◆ getCartY()

double CoordZ::getCartY ( CoordZSpheroidType  type = COORDZ_SPHERE) const

Gets cartesian y coordinate

Parameters
typeEarh Model type
Returns
y in meters

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

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

Here is the call graph for this function:

◆ getCartZ()

double CoordZ::getCartZ ( CoordZSpheroidType  type = COORDZ_SPHERE) const

Gets cartesian z coordinate

Parameters
typeEarh Model type
Returns
z in meters

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

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

Here is the call graph for this function:

◆ getCoordZAlongCartLine()

const CoordZ CoordZ::getCoordZAlongCartLine ( const CoordZ start,
const CoordZ end,
double  distance 
)
static

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(), 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()

const CoordZ CoordZ::getCoordZAlongGreatCircle ( const CoordZ start,
const CoordZ end,
double  distance 
)
static

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 CoordZ(), woss::Coord::getCoordAlongGreatCircle(), getDepth(), and woss::Coord::getGreatCircleDistance().

Here is the call graph for this function:

◆ getCoordZFromCartesianCoords() [1/2]

const CoordZ CoordZ::getCoordZFromCartesianCoords ( const CartCoords cart_coords)
static

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]

const CoordZ CoordZ::getCoordZFromCartesianCoords ( double  x,
double  y,
double  z,
CoordZSpheroidType  type = COORDZ_SPHERE 
)
static

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(), 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 getCoordZFromCartesianCoords().

Here is the call graph for this function:

◆ getCoordZFromSphericalCoords()

const CoordZ CoordZ::getCoordZFromSphericalCoords ( double  rho,
double  theta,
double  phi 
)
static

Gets the CoordZ converted from given spherical coordinates

Parameters
rhoradius
thetatheta angle
phiphi angle
Returns
a valid CoordZ object

References CoordZ(), and woss::Coord::EARTH_RADIUS.

Here is the call graph for this function:

◆ getDepth()

◆ getSphericalPhi()

double CoordZ::getSphericalPhi ( ) const

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

Returns
z in meters

References woss::Coord::longitude.

◆ getSphericalRho()

double CoordZ::getSphericalRho ( ) const

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()

double CoordZ::getSphericalTheta ( ) const

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

Returns
y in meters

References woss::Coord::latitude.

◆ isValid()

virtual bool woss::CoordZ::isValid ( ) const
inlinevirtual

Checks the validity of coordinates and depth provided

Returns
true if coordinates and depth are valid, false otherwise

Reimplemented from woss::Coord.

References COORDZ_MIN_DEPTH, depth, and woss::Coord::isValid().

Referenced by getCartDistance(), getCartRelAzimuth(), getCartRelZenith(), woss::ACToolboxWoss::initCoordZVector(), woss::Location::isEquivalentTo(), woss::ACToolboxWoss::isValid(), woss::Location::isValid(), woss::operator+=(), woss::operator-=(), and woss::Woss::Woss().

Here is the call graph for this function:

◆ operator<<()

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

<< operator

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

◆ operator=()

CoordZ & CoordZ::operator= ( const CoordZ coordz)

Assignment operator

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

References depth, woss::Coord::latitude, woss::Coord::longitude, woss::Coord::marsden_one_degree, and woss::Coord::marsden_square.

◆ setDepth()

void woss::CoordZ::setDepth ( double  d)
inline

Sets depth

Parameters
ddepth in meters

References depth.

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

Friends And Related Function Documentation

◆ operator!=

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+

const 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+=

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-

const 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-=

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<

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<=

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==

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>

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>=

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

◆ depth


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