Kstars

greatcircle.h
1/*
2 SPDX-FileCopyrightText: 2021 Hy Murveit <hy@murveit.com>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
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.
16// See https://en.wikipedia.org/wiki/Great-circle_navigation
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) const;
46 double altAtAz(double azDegrees) const;
47 private:
48 // These are values computed in the constructor needed by all waypoints.
49 double sigma01, sigma02, lambda0;
50 double cosAlpha0, sinAlpha0, alpha0;
51};
A class to compute points along a great circle from one az/alt to another.
Definition greatcircle.h:28
GreatCircle(double az1, double alt1, double az2, double alt2)
Construct a GreatCircle object for a path between az1,alt1 to az2,alt2.
void waypoint(double fraction, double *az, double *alt) const
Return the azimuth and altitude for a waypoint.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:04:47 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.