Документ взят из кэша поисковой машины. Адрес оригинального документа : http://www.apo.nmsu.edu/Telescopes/coordConv/html/coord_8h_source.html
Дата изменения: Thu May 7 21:42:46 2015
Дата индексирования: Sun Apr 10 01:54:32 2016
Кодировка:
lsst.coordConv: include/coordConv/coord.h Source File
lsst.coordConv  unknown
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
coord.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <limits>
4 #include <map>
5 #include <string>
6 #include "Eigen/Dense"
7 
8 namespace coordConv {
9 
10  const double MinParallax = 1e-7; // minimum parallax (arcsec)
11 
12  double distanceFromParallax(double parallax);
13 
14  double parallaxFromDistance(double dist);
15 
27  class Coord {
28  public:
36  explicit Coord(double equatAng, double polarAng, double parallax=0);
37 
49  explicit Coord(double equatAng, double polarAng, double parallax, double equatPM, double polarPM, double radVel);
50 
57  explicit Coord(Eigen::Vector3d const &pos);
58 
66  explicit Coord(Eigen::Vector3d const &pos, Eigen::Vector3d const &pm);
67 
71  explicit Coord();
72 
73  ~Coord() {};
74 
81  bool atInfinity() const { return _atInfinity; }
82 
86  bool atPole() const { return _atPole; }
87 
94  double getDistance() const { return _dist; }
95 
101  double getParallax() const;
102 
110  bool getSphPos(double &equatAng, double &polarAng) const;
111 
119  bool getPM(double &equatPM, double &polarPM) const;
120 
128  double getRadVel() const;
129 
135  Eigen::Vector3d const getVecPos() const { return _pos; }
136 
142  Eigen::Vector3d const getVecPM() const { return _pm; }
143 
147  bool isfinite() const;
148 
154  double angularSeparation(Coord const &coord) const;
155 
165  double orientationTo(Coord const &coord) const;
166 
189  Coord offset(double &toOrient, double fromOrient, double dist) const;
190 
191  bool operator==(Coord const &rhs) {
192  return (this->getVecPos() == rhs.getVecPos()) && (this->getVecPM() == rhs.getVecPM());
193  }
194 
195  bool operator!=(Coord const &rhs) {
196  return !operator==(rhs);
197  }
198 
202  std::string __repr__() const;
203 
204  private:
205  Eigen::Vector3d _pos; // vector position (AU)
206  Eigen::Vector3d _pm; // vector proper motion and radial velocity (AU/year)
207  double _dist; // distance (AU); a cache of _pos.norm()
208  bool _atInfinity; // true if distance far enough; a cached value
209  bool _atPole; // true if very near the pole; a cached value
210 
220  void _setPosFromSph(double equatAng, double polarAng, double parallax);
221 
227  void _setCache();
228  };
229 
230  std::ostream &operator<<(std::ostream &out, Coord const &coord);
231 
232 }
double angularSeparation(Coord const &coord) const
Definition: coord.cc:150
std::string __repr__() const
Definition: coord.cc:227
bool atInfinity() const
Definition: coord.h:81
const double MinParallax
Definition: coord.h:10
bool getSphPos(double &equatAng, double &polarAng) const
Definition: coord.cc:82
bool isfinite() const
Definition: coord.cc:141
Eigen::Vector3d const getVecPM() const
Definition: coord.h:142
double distanceFromParallax(double parallax)
Definition: coord.cc:12
bool getPM(double &equatPM, double &polarPM) const
Definition: coord.cc:98
double parallaxFromDistance(double dist)
Definition: coord.cc:16
double getRadVel() const
Definition: coord.cc:134
Coord offset(double &toOrient, double fromOrient, double dist) const
Definition: coord.cc:172
Eigen::Vector3d const getVecPos() const
Definition: coord.h:135
double getParallax() const
Definition: coord.cc:78
bool atPole() const
Definition: coord.h:86
double orientationTo(Coord const &coord) const
Definition: coord.cc:156
std::ostream & operator<<(std::ostream &out, Coord const &coord)
Definition: coord.cc:263
bool operator==(Coord const &rhs)
Definition: coord.h:191
double getDistance() const
Definition: coord.h:94
bool operator!=(Coord const &rhs)
Definition: coord.h:195