226 m_alt = std::asin(vector[2]);
227 m_az = std::atan2(vector[1], vector[0]);
255 GMatrix rot = (ry * rz).transpose();
260 double cos_phi = std::cos(phi_rad);
261 double sin_phi = std::sin(phi_rad);
262 double cos_theta = std::cos(theta_rad);
263 double sin_theta = std::sin(theta_rad);
264 GVector native(-cos_phi*sin_theta, sin_phi*sin_theta, cos_theta);
285 double cosaz = std::cos(
m_az);
286 double sinaz = std::sin(
m_az);
287 double cosalt = std::cos(
m_alt);
288 double sinalt = std::sin(
m_alt);
289 GVector vector(cosalt*cosaz, cosalt*sinaz, sinalt);
308 double cosdis = std::sin(
m_alt) * std::sin(dir.
alt()) +
309 std::cos(
m_alt) * std::cos(dir.
alt()) *
310 std::cos(dir.
az() -
m_az);
431 if (std::abs(std::abs(a.
m_alt) - 90.0) < 1e-10) {
Exception handler interface definition.
bool operator==(const GHorizDir &a, const GHorizDir &b)
Equality operator.
bool operator!=(const GHorizDir &a, const GHorizDir &b)
Non equality operator.
Horizontal direction class interface definition.
Mathematical function definitions.
Generic matrix class definition.
Vector class interface definition.
Horizontal (Alt/Az) direction class.
void clear(void)
Clear horizontal direction.
void rotate_deg(const double &phi, const double &theta)
Rotate horizontal direction by zenith and azimuth angle.
GHorizDir * clone(void) const
Clone horizontal direction.
double dist_deg(const GHorizDir &dir) const
Compute angular distance to horizontal direction in degrees.
GVector celvector(void) const
Return horizontal direction as 3D vector.
void copy_members(const GHorizDir &dir)
Copy class members.
void init_members(void)
Initialise class members.
double m_az
azimuth in radians
void free_members(void)
Delete class members.
GHorizDir & operator=(const GHorizDir &dir)
Assignment operator.
double dist(const GHorizDir &dir) const
Compute angular distance to horizontal direction in radians.
GHorizDir(void)
Constructor.
const double & az(void) const
Return azimuth angle in radians.
void altaz(const double &alt, const double &az)
Set horizontal direction (radians)
const double & alt(void) const
Return altitude angle in radians.
std::string print(const GChatter &chatter=NORMAL) const
Print horizontal direction information.
virtual ~GHorizDir(void)
Destructor.
double m_alt
altitude in radians
void altaz_deg(const double &alt, const double &az)
Set horizontal direction (degrees)
Generic matrix class definition.
void eulerz(const double &angle)
Set Euler rotation matrix around z axis.
void eulery(const double &angle)
Set Euler rotation matrix around y axis.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
double acos(const double &arg)
Computes acos by avoiding NaN due to rounding errors.