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

Auxiliary data structure for pair of angles. More...

#include <JAstronomy.hh>

Inheritance diagram for JASTRONOMY::angle_type:
JLANG::JEquals< JFirst_t, JSecond_t > JASTRONOMY::angle_type_deg JASTRONOMY::angle_type_rad JASTRONOMY::JGalacticCoordinates JASTRONOMY::JGeographicalLocation JASTRONOMY::JNeutrinoDirection JASTRONOMY::JSourceLocation JASTRONOMY::JSourceLocationJ2000 JASTRONOMY::JAstronomy JASTRONOMY::JMorphology JASTRONOMY::JMorphologyBinary JASTRONOMY::JMorphologyGauss JASTRONOMY::JMorphologyGauss2D JASTRONOMY::JMorphologyHistogram JASTRONOMY::JMorphologyPoint

Public Member Functions

bool equals (const angle_type &angle, const double precision=std::numeric_limits< double >::min()) const
 Check equality.
 

Protected Member Functions

 angle_type ()
 Default constructor.
 
 angle_type (const double theta, const double phi)
 Constructor.
 

Protected Attributes

double _theta_
 
double _phi_
 

Friends

std::istream & operator>> (std::istream &in, angle_type &object)
 Read pair of angles from input stream.
 
std::ostream & operator<< (std::ostream &out, const angle_type &object)
 Write pair of angles to output stream.
 

Detailed Description

Auxiliary data structure for pair of angles.

Definition at line 184 of file JAstronomy.hh.

Constructor & Destructor Documentation

◆ angle_type() [1/2]

JASTRONOMY::angle_type::angle_type ( )
inlineprotected

Default constructor.

Definition at line 232 of file JAstronomy.hh.

232 :
233 _theta_(0.0),
234 _phi_ (0.0)
235 {}

◆ angle_type() [2/2]

JASTRONOMY::angle_type::angle_type ( const double theta,
const double phi )
inlineprotected

Constructor.

Parameters
thetatheta
phiphi

Definition at line 244 of file JAstronomy.hh.

245 :
246 _theta_(theta),
247 _phi_ (phi)
248 {}

Member Function Documentation

◆ equals()

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

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 }

Friends And Related Symbol Documentation

◆ operator>>

std::istream & operator>> ( std::istream & in,
angle_type & object )
friend

Read pair of angles from input stream.

Parameters
ininput stream
objectpair of angles
Returns
input stream

Definition at line 209 of file JAstronomy.hh.

210 {
211 return in >> object._theta_
212 >> object._phi_;
213 }

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const angle_type & object )
friend

Write pair of angles to output stream.

Parameters
outoutput stream
objectpair of angles
Returns
output stream

Definition at line 222 of file JAstronomy.hh.

223 {
224 return out << FIXED(12,7) << object._theta_ << ' '
225 << FIXED(12,7) << object._phi_;
226 }
Auxiliary data structure for floating point format specification.
Definition JManip.hh:448

Member Data Documentation

◆ _theta_

double JASTRONOMY::angle_type::_theta_
protected

Definition at line 250 of file JAstronomy.hh.

◆ _phi_

double JASTRONOMY::angle_type::_phi_
protected

Definition at line 251 of file JAstronomy.hh.


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