Jpp 19.3.0
the software that should make you happy
Loading...
Searching...
No Matches
JASTRONOMY::JGalacticCoordinates Struct Reference

Location of astrophysical source in Galactic coordinates. More...

#include <JAstronomy.hh>

Inheritance diagram for JASTRONOMY::JGalacticCoordinates:
JASTRONOMY::angle_type_rad JASTRONOMY::angle_type JLANG::JEquals< JFirst_t, JSecond_t >

Public Member Functions

 JGalacticCoordinates ()
 Default constructor.
 
 JGalacticCoordinates (const double latitude, const double longitude)
 Constructor.
 
 JGalacticCoordinates (const JSourceLocationJ2000 &location)
 Constructor.
 
 JGalacticCoordinates (const JAngle3D &angle)
 Constructor.
 
const JGalacticCoordinatesgetGalacticCoordinates () const
 Get Galactic coordinates.
 
 operator JAngle3D () const
 Type conversion operator.
 
double getLatitude () const
 Get latitude.
 
double getLongitude () const
 Get longitude.
 
double getDot (const JGalacticCoordinates &location) const
 Dot product.
 
void set (const angle_type_deg &angle)
 Convert angle.
 
bool equals (const angle_type &angle, const double precision=std::numeric_limits< double >::min()) const
 Check equality.
 

Protected Attributes

double _theta_
 
double _phi_
 

Detailed Description

Location of astrophysical source in Galactic coordinates.

Definition at line 639 of file JAstronomy.hh.

Constructor & Destructor Documentation

◆ JGalacticCoordinates() [1/4]

JASTRONOMY::JGalacticCoordinates::JGalacticCoordinates ( )
inline

Default constructor.

Definition at line 645 of file JAstronomy.hh.

646 {}

◆ JGalacticCoordinates() [2/4]

JASTRONOMY::JGalacticCoordinates::JGalacticCoordinates ( const double latitude,
const double longitude )
inline

Constructor.

Parameters
latitudeGalactic latitude [rad]
longitudeGalactic longitude [rad]

Definition at line 655 of file JAstronomy.hh.

656 :
657 angle_type_rad(latitude, longitude)
658 {}
angle_type_rad()
Default constructor.

◆ JGalacticCoordinates() [3/4]

JASTRONOMY::JGalacticCoordinates::JGalacticCoordinates ( const JSourceLocationJ2000 & location)

Constructor.

Parameters
locationsource location

Definition at line 739 of file JAstronomy.hh.

740 {
741 double dec = location.getDeclination();
742 double ra = location.getRightAscension();
743
744 slaEqgal(ra, dec, &this->_phi_, &this->_theta_);
745 }

◆ JGalacticCoordinates() [4/4]

JASTRONOMY::JGalacticCoordinates::JGalacticCoordinates ( const JAngle3D & angle)
inline

Constructor.

Parameters
anglepolar angles [rad]

Definition at line 674 of file JAstronomy.hh.

674 :
675 angle_type_rad(PI/2 - angle.getTheta(), angle.getPhi())
676 {}

Member Function Documentation

◆ getGalacticCoordinates()

const JGalacticCoordinates & JASTRONOMY::JGalacticCoordinates::getGalacticCoordinates ( ) const
inline

Get Galactic coordinates.

Returns
Galactic coordinates

Definition at line 684 of file JAstronomy.hh.

685 {
686 return static_cast<const JGalacticCoordinates&>(*this);
687 }
JGalacticCoordinates()
Default constructor.

◆ operator JAngle3D()

JASTRONOMY::JGalacticCoordinates::operator JAngle3D ( ) const
inline

Type conversion operator.

Returns
polar angles [rad]

Definition at line 695 of file JAstronomy.hh.

696 {
697 return JAngle3D(PI/2 - _theta_, _phi_);
698 }

◆ getLatitude()

double JASTRONOMY::JGalacticCoordinates::getLatitude ( ) const
inline

Get latitude.

Definition at line 701 of file JAstronomy.hh.

◆ getLongitude()

double JASTRONOMY::JGalacticCoordinates::getLongitude ( ) const
inline

Get longitude.

Definition at line 702 of file JAstronomy.hh.

◆ getDot()

double JASTRONOMY::JGalacticCoordinates::getDot ( const JGalacticCoordinates & location) const
inline

Dot product.

Parameters
locationsource location
Returns
dot product

Definition at line 711 of file JAstronomy.hh.

712 {
713 return
714 cos(this->_theta_) * cos(location._theta_) * cos(this->_phi_ - location._phi_) +
715 sin(this->_theta_) * sin(location._theta_);
716 }

◆ set()

void JASTRONOMY::angle_type_rad::set ( const angle_type_deg & angle)
inlineinherited

Convert angle.

Parameters
angleangle [rad]

Definition at line 293 of file JAstronomy.hh.

294 {
295 static_cast<angle_type_rad&>(*this) = angle_type_rad(angle);
296 }

◆ equals()

bool JASTRONOMY::angle_type::equals ( const angle_type & angle,
const double precision = std::numeric_limits<double>::min() ) const
inlineinherited

Check equality.

Parameters
anglepair of angles
precisionprecision
Returns
true if angles are equal; else false

Definition at line 194 of file JAstronomy.hh.

196 {
197 return (fabs(this->_theta_ - angle._theta_) <= precision &&
198 fabs(this->_phi_ - angle._phi_) <= precision);
199 }

Member Data Documentation

◆ _theta_

double JASTRONOMY::angle_type::_theta_
protectedinherited

Definition at line 250 of file JAstronomy.hh.

◆ _phi_

double JASTRONOMY::angle_type::_phi_
protectedinherited

Definition at line 251 of file JAstronomy.hh.


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