ModelSpace
All Classes Namespaces Functions Variables Enumerations Pages
kepler.h
1/******************************************************************************
2* Copyright (c) ATTX LLC 2024. All Rights Reserved.
3*
4* This software and associated documentation (the "Software") are the
5* proprietary and confidential information of ATTX, LLC. The Software is
6* furnished under a license agreement between ATTX and the user organization
7* and may be used or copied only in accordance with the terms of the agreement.
8* Refer to 'license/attx_license.adoc' for standard license terms.
9*
10* EXPORT CONTROL NOTICE: THIS SOFTWARE MAY INCLUDE CONTENT CONTROLLED UNDER THE
11* INTERNATIONAL TRAFFIC IN ARMS REGULATIONS (ITAR) OR THE EXPORT ADMINISTRATION
12* REGULATIONS (EAR99). No part of the Software may be used, reproduced, or
13* transmitted in any form or by any means, for any purpose, without the express
14* written permission of ATTX, LLC.
15******************************************************************************/
16/*
17Kepler header file
18-------------------
19This file contains a number of utilities for calculating parameters associated
20with keplerian orbits.
21
22Author: Alex Reynolds
23*/
24#ifndef UTILS_KEPLER_H
25#define UTILS_KEPLER_H
26
27#include "core/CartesianVector.hpp"
28#include "core/macros.h"
29
30namespace clockwerk {
31 /// @brief Function to propagate a body between two points in time using a keplerian orbit
32 /// @param time The time for which the orbit should be propagated
33 /// @param mu The gravitational parameter for the central planet
34 /// @param pos_initial The initial position of the body
35 /// @param vel_initial The initial velocity of the body
36 /// @param pos_final The position of the body after propagation
37 /// @param vel_final The velocity of the body after propagation
38 /// @return Error code corresponding to success/failure
39 int twoBodyPropagate(double time, double mu,
40 CartesianVector3D pos_initial, CartesianVector3D vel_initial,
41 CartesianVector3D &pos_final, CartesianVector3D &vel_final);
42
43 /// @brief Function to convert mean anomaly to eccentric anomaly
44 /// @param mean_anomaly
45 /// @param eccentricity The orbit eccentricity
46 /// @param eccentric_anomaly
47 /// @param tol The tolerance for iterative conversion
48 /// @param max_iter The maximum number of iterations after which the solver will exit
49 /// @return Error code corresponding to success/failure
50 int mean2eccentric(double mean_anomaly, double eccentricity, double &eccentric_anomaly,
51 double tol, int max_iter);
52
53 /// @brief Function to convert eccentric anomaly to true anomaly
54 /// @param eccentric_anomaly
55 /// @param eccentricity The orbit eccentricity
56 /// @param true_anomaly
57 /// @return Error code corresponding to success/failure
58 int eccentric2true(double eccentric_anomaly, double eccentricity, double &true_anomaly);
59
60 /// @brief Function to convert true anomaly to eccentric anomaly
61 /// @param true_anomaly
62 /// @param eccentricity The orbit eccentricity
63 /// @param eccentric_anomaly
64 /// @return Error code corresponding to success/failure
65 int true2eccentric(double true_anomaly, double eccentricity, double &eccentric_anomaly);
66
67 /// @brief Function to convert eccentric anomaly to mean anomaly
68 /// @param eccentric_anomaly
69 /// @param eccentricity The orbit eccentricity
70 /// @param mean_anomaly
71 /// @return Error code corresponding to success/failure
72 int eccentric2mean(double eccentric_anomaly, double eccentricity, double &mean_anomaly);
73}
74
75#endif
#define CartesianVector3D
Definition macros.h:54