File indexing completed on 2025-02-16 09:47:25
0001 /* 0002 SPDX-FileCopyrightText: 2020 Chris Rowland <chris.rowland@cherryfield.me.uk> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include <dms.h> 0010 #include <skypoint.h> 0011 #include "rotations.h" 0012 0013 /** 0014 *@class PoleAxis 0015 *@short PoleAxis class handles determining the mount Ha axis position given three positions taken with the same mount declination. 0016 * 0017 *@author Chris Rowland 0018 *@version 1.0 0019 */ 0020 class PoleAxis 0021 { 0022 public: 0023 /// 0024 /// \brief dirCos converts primary and secondary angles to a directional cosine 0025 /// \param primary angle, can be Ra, Ha, Azimuth or the corresponding axis values 0026 /// \param secondary angle, can be Dec, Altitude. 90 deg is the pole 0027 /// \return V3 containing the directional cosine. 0028 static Rotations::V3 dirCos(const dms primary, const dms secondary); 0029 0030 /// 0031 /// \brief dirCos converts a SkyPoint to a directional cosine 0032 /// \param sp SkyPoint with the position 0033 /// \return V3 containing the directional cosine. 0034 /// 0035 static Rotations::V3 dirCos(const SkyPoint sp); 0036 0037 /// 0038 /// \brief primary returns the primary dms value in the directional cosine 0039 /// \param dirCos 0040 /// \return primary angle, Ra, Ha, Azimuth etc. 0041 /// 0042 static dms primary(Rotations::V3 dirCos); 0043 0044 /// 0045 /// \brief secondary returns the secondary dms angle in the directional cosine 0046 /// \param dirCos 0047 /// \return 0048 /// 0049 static dms secondary(Rotations::V3 dirCos); 0050 0051 /// 0052 /// \brief skyPoint returns a skypoint derived from the directional cosine vector 0053 /// \param dc 0054 /// \return 0055 /// 0056 static SkyPoint skyPoint(Rotations::V3 dc); 0057 0058 /// 0059 /// \brief poleAxis returns the pole axis vector given three SkyPoints with the same mount declination 0060 /// \param p1 0061 /// \param p2 0062 /// \param p3 0063 /// \return vector giving the direction of the pole. The rotation between the three points determines which pole 0064 /// the other pole can be determined either by reversing the sign of the declination and adding 12 hrs to the Ha or 0065 /// by negating the vector 0066 /// 0067 static Rotations::V3 poleAxis(SkyPoint p1, SkyPoint p2, SkyPoint p3); 0068 0069 };