sac-format 0.6.0
C++20 SAC (Seismic Analysis Code) File Library
Loading...
Searching...
No Matches
sacfmt::coord Class Reference

Defines a geographic coordinant (degrees/radians) More...

#include <sac_format.hpp>

Public Member Functions

 coord () noexcept
 Default coordinate constructor.
 
 coord (double value, bool degrees=true) noexcept
 Coordinate constructor.
 
double degrees () const noexcept
 Get coordinate value in decimal degrees.
 
double radians () const noexcept
 Get coordinate value in radians.
 
void degrees (double value) noexcept
 Set coordinate value using decimal degrees.
 
void radians (double value) noexcept
 Set coordainate value using radians.
 

Private Attributes

double deg {}
 coordinate value in decimal degrees.
 
double rad {}
 coordinate value in radians.
 

Detailed Description

Defines a geographic coordinant (degrees/radians)

Constructor & Destructor Documentation

◆ coord() [1/2]

sacfmt::coord::coord()
noexcept

Default coordinate constructor.

◆ coord() [2/2]

sacfmt::coord::coord(double value,
bool degrees = true 
)
explicitnoexcept

Coordinate constructor.

Parameters
[in]valueDouble value of coordinate
[in]degreesBoolean value, true if degrees (false = radians).
683 {
684 if (degrees) {
685 deg = value;
686 rad = degrees_to_radians(value);
687 } else {
688 rad = value;
689 deg = radians_to_degrees(value);
690 }
691}
double rad
coordinate value in radians.
Definition sac_format.hpp:280
double degrees() const noexcept
Get coordinate value in decimal degrees.
Definition sac_format.hpp:269
double deg
coordinate value in decimal degrees.
Definition sac_format.hpp:278
double degrees_to_radians(double degrees) noexcept
Convert decimal degrees to radians.
Definition sac_format.cpp:659
double radians_to_degrees(double radians) noexcept
Convert radians to decimal degrees.
Definition sac_format.cpp:673
Here is the call graph for this function:

Member Function Documentation

◆ degrees() [1/2]

double sacfmt::coord::degrees()const
inlinenoexcept

Get coordinate value in decimal degrees.

269{ return deg; };

◆ degrees() [2/2]

void sacfmt::coord::degrees(double value)
noexcept

Set coordinate value using decimal degrees.

Parameters
[in]valuedouble coordinate in decimal degrees.
698 {
699 deg = value;
700 rad = degrees_to_radians(value);
701}
Here is the call graph for this function:

◆ radians() [1/2]

double sacfmt::coord::radians()const
inlinenoexcept

Get coordinate value in radians.

271{ return rad; };

◆ radians() [2/2]

void sacfmt::coord::radians(double value)
noexcept

Set coordainate value using radians.

Parameters
[in]valuedouble coordinate in radians.
708 {
709 rad = value;
710 deg = radians_to_degrees(value);
711}
Here is the call graph for this function:

Member Data Documentation

◆ deg

double sacfmt::coord::deg {}
private

coordinate value in decimal degrees.

278{};

◆ rad

double sacfmt::coord::rad {}
private

coordinate value in radians.

280{};

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