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

Location of detector. More...

#include <JAstronomy.hh>

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

Public Member Functions

 JGeographicalLocation ()
 Default constructor.
 
 JGeographicalLocation (const double latitude, const double longitude)
 Constructor.
 
 JGeographicalLocation (const int degreesNorth, const int minutesNorth, const int degreesEast, const int minutesEast)
 Constructor.
 
 JGeographicalLocation (const JAngle3D &angle)
 Constructor.
 
const JGeographicalLocationgetGeographicalLocation () const
 Get geographical location.
 
 operator JAngle3D () const
 Type conversion operator.
 
double getLatitude () const
 Get latitude.
 
double getLongitude () const
 Get longitude.
 
double getDot (const JGeographicalLocation &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 detector.

Definition at line 827 of file JAstronomy.hh.

Constructor & Destructor Documentation

◆ JGeographicalLocation() [1/4]

JASTRONOMY::JGeographicalLocation::JGeographicalLocation ( )
inline

Default constructor.

Definition at line 833 of file JAstronomy.hh.

834 {}

◆ JGeographicalLocation() [2/4]

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

Constructor.

Parameters
latitudelatitude
longitudelongitude

Definition at line 843 of file JAstronomy.hh.

844 :
845 angle_type_rad(latitude, longitude)
846 {}
angle_type_rad()
Default constructor.

◆ JGeographicalLocation() [3/4]

JASTRONOMY::JGeographicalLocation::JGeographicalLocation ( const int degreesNorth,
const int minutesNorth,
const int degreesEast,
const int minutesEast )
inline

Constructor.

Parameters
degreesNorthdegrees North
minutesNorthminutes North
degreesEastdegrees East
minutesEastminutes East

Definition at line 857 of file JAstronomy.hh.

860 :
861 angle_type_rad(getRadians((double) degreesNorth + (double) minutesNorth / 60.0),
862 getRadians((double) degreesEast + (double) minutesEast / 60.0))
863 {}
double getRadians(const double angle)
Convert angle to radians.

◆ JGeographicalLocation() [4/4]

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

Constructor.

Parameters
anglepolar angles [rad]

Definition at line 871 of file JAstronomy.hh.

871 :
872 angle_type_rad(PI/2 - angle.getTheta(), angle.getPhi())
873 {}

Member Function Documentation

◆ getGeographicalLocation()

const JGeographicalLocation & JASTRONOMY::JGeographicalLocation::getGeographicalLocation ( ) const
inline

Get geographical location.

Returns
geographical location

Definition at line 881 of file JAstronomy.hh.

882 {
883 return static_cast<const JGeographicalLocation&>(*this);
884 }
JGeographicalLocation()
Default constructor.

◆ operator JAngle3D()

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

Type conversion operator.

Returns
polar angles [rad]

Definition at line 892 of file JAstronomy.hh.

893 {
894 return JAngle3D(PI/2 - _theta_, _phi_);
895 }

◆ getLatitude()

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

Get latitude.

Definition at line 898 of file JAstronomy.hh.

◆ getLongitude()

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

Get longitude.

Definition at line 899 of file JAstronomy.hh.

◆ getDot()

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

Dot product.

Parameters
locationlocation
Returns
dot product

Definition at line 908 of file JAstronomy.hh.

909 {
910 return
911 sin(this->_theta_) * sin(location._theta_) +
912 cos(this->_theta_) * cos(location._theta_) * cos(this->_phi_ - location._phi_);
913 }

◆ 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: