Kstars

greatcircle.h
1 /*
2  SPDX-FileCopyrightText: 2021 Hy Murveit <[email protected]>
3
5 */
6
7 // Example usage:
8 //
9 // double az1 = ..., alt1 = ..., az2 = ..., alt2 = ...;
10 // GreatCircle gc(az1, alt1, az2, alt2);
11 // double az, alt;
12 // gc.waypoint(0.75, &az, &alt);
13 //
14 // az and alt will contain the coordinates for a waypoint 75% of the way
15 // between az1,alt1 and az2,alt2 along a great circle path.
17
18 #pragma once
19
20 #include <QObject>
21
22 /**
23  * @brief A class to compute points along a great circle from one az/alt to another.
24  * @author Hy Murveit
25  * @version 1.0
26  */
28 {
29  public:
30  /**
31  * @brief Construct a GreatCircle object for a path between az1,alt1 to az2,alt2
32  * @param az1 starting azimuth value (degrees).
33  * @param alt1 starting altitude value (degrees).
34  * @param az2 ending azimuth value (degrees).
35  * @param alt2 ending altitude value (degrees).
36  */
37  GreatCircle(double az1, double alt1, double az2, double alt2);
38
39  /**
40  * @brief Return the azimuth and altitude for a waypoint
41  * @param fraction the desired fraction of the total path
42  * @param az the returned azimuth value (degrees)
43  * @param alt the returned altitude value (degrees)
44  */
45  void waypoint(double fraction, double *az, double *alt);
46
47  private:
48  // These are values computed in the constructor needed by all waypoints.
49  double sigma01, sigma02, lambda0;
50  double cosAlpha0, sinAlpha0;
51 };
A class to compute points along a great circle from one az/alt to another.
Definition: greatcircle.h:27
void waypoint(double fraction, double *az, double *alt)
Return the azimuth and altitude for a waypoint.
Definition: greatcircle.cpp:77
GreatCircle(double az1, double alt1, double az2, double alt2)
Construct a GreatCircle object for a path between az1,alt1 to az2,alt2.
Definition: greatcircle.cpp:37
This file is part of the KDE documentation.