File indexing completed on 2024-04-14 03:43:20

0001 /*
0002     SPDX-FileCopyrightText: 2008 Akarsh Simha <kstar@bas.org.in>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 #include "approachsolver.h"
0009 
0010 class GeoLocation;
0011 class KSPlanetBase;
0012 class SkyObject;
0013 
0014 /**
0015  * @class KSConjunct
0016  * @short Implements algorithms to find close conjunctions of planets in a given time range.
0017  * A class that implements a method to compute close conjunctions between any two solar system
0018  * objects excluding planetary moons. Given two such objects, this class has implementations of
0019  * algorithms required to find the time of closest approach in a given range of time.
0020  *
0021  * @author Akarsh Simha
0022  * @version 2.0
0023  */
0024 class KSConjunct : public ApproachSolver
0025 {
0026 Q_OBJECT
0027 public:
0028     /** Constructor. Instantiates a KSNumbers for internal computations. */
0029     KSConjunct();
0030 
0031     void setObject1(SkyObject_s &obj) { m_object1 = obj; }
0032     void setObject2(KSPlanetBase_s &obj) { m_object2 = obj; }
0033     void setOpposition(bool opposition) { m_opposition = opposition; }
0034 
0035 signals:
0036     void madeProgress(int);
0037 
0038 protected:
0039     double findInitialStep(long double startJD, long double stopJD) override;
0040     void updatePositions(long double jd) override;
0041 
0042 private:
0043     dms findDistance() override;
0044 
0045 
0046     SkyObject_s m_object1;
0047     KSPlanetBase_s m_object2;
0048     bool m_opposition { false };
0049 };
0050