MineLink
 All Data Structures Functions Variables Pages
delphos::Coordinates Class Reference

An utility class to abstract coordinates so they can be used as map and set keys by means of string conversion. More...

#include <coords.h>

Collaboration diagram for delphos::Coordinates:
Collaboration graph

Public Member Functions

 Coordinates (const float &x, const float &y, const float &z)
 Creates the coordinates with given location.
 
 Coordinates (const delphos::Coordinates &other)
 Copy constructor.
 
 Coordinates ()
 Creates coordinates with location \((0,0,0)\).
 
string ToString () const
 Converts the coordinates to its representation as a string. More...
 
const float X () const
 Retrieves the \(x\) component of the coordinates. More...
 
const float Y () const
 Retrieves the \(y\) component of the coordinates. More...
 
const float Z () const
 Retrieves the \(z\) component of the coordinates. More...
 
bool InSlopeAngle (const double &vertical_angle_degrees, const double &max_z_diff, const delphos::Coordinates &other, const double tolerance=0.001) const
 Checks whether the coordinates are within the precedence cone of another coordinates. More...
 

Detailed Description

An utility class to abstract coordinates so they can be used as map and set keys by means of string conversion.

In practice, a Coordinates instance is just a container for \((x,y,z)\) spatial coordinates.

Member Function Documentation

bool delphos::Coordinates::InSlopeAngle ( const double &  vertical_angle_degrees,
const double &  max_z_diff,
const delphos::Coordinates other,
const double  tolerance = 0.001 
) const

Checks whether the coordinates are within the precedence cone of another coordinates.

Parameters
vertical_angle_degreesThe precedence angle, in degrees, measured from vertical axis downwards.
max_z_diffMaximum vertical distance to consider for cone construction.
otherThe other coordinates (candidate to be succesor).
toleranceNumerical tolerance in the computation.

The current coordinates are checked whether it correpond to a point inside (or not) of the precedence cone constructed with vertex on the coordinates of the "other" coordinates and height equal to max_z_diff.

Returns
True if the current coordinates are inside the cone, false otherwise.
string delphos::Coordinates::ToString ( ) const

Converts the coordinates to its representation as a string.

Returns
A string representation of the tiplet \((x,y,z)\).

The string format is as follows, if \((x_0,y_0,z_0)\) are the spatial coordinates, then the representation will be \(x_0\#y_0\#z_0\).

const float delphos::Coordinates::X ( ) const

Retrieves the \(x\) component of the coordinates.

Returns
The value of the stored \(x\) coordinate.
const float delphos::Coordinates::Y ( ) const

Retrieves the \(y\) component of the coordinates.

Returns
The value of the stored \(y\) coordinate.
const float delphos::Coordinates::Z ( ) const

Retrieves the \(z\) component of the coordinates.

Returns
The value of the stored \(z\) coordinate.

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