WarpTwin
Documentation for WarpTwin models and classes.
Loading...
Searching...
No Matches
orbitutils.h
Go to the documentation of this file.
1/******************************************************************************
2* Copyright (c) ATTX INC 2025. All Rights Reserved.
3*
4* This software and associated documentation (the "Software") are the
5* proprietary and confidential information of ATTX INC. 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 INC.
15******************************************************************************/
16/*
17Orbit Utilities header file
18---------------------------
19This file contains orbit utilities for converting between "classical"
20keplerian orbital elements and xyz cartesian position and velocity.
21
22It also contains a number of utilities for calculating parameters associated
23with keplerian orbits.
24
25TODO: Protect edge cases in these files. Right now they only work for
26elliptical orbits
27
28The converters in this file are based on those found in Vallado's
29Fundamentals of Astrodynamics and Applications, fourth edition, Chapter
302.5. The test cases are drawn from that text as well.
31
32Author: Alex Reynolds
33*/
34#ifndef UTILS_ORBIT_UTILS_H
35#define UTILS_ORBIT_UTILS_H
36
37#include "core/Matrix.hpp"
39#include "frames/Frame.h"
40#include "dynamics/DCM.h"
41
42namespace warptwin {
46 double true2eccentric(double true_anomaly);
47
61 int rv2coe(const CartesianVector3 &pos,
62 const CartesianVector3 &vel,
63 double mu,
64 CartesianVector6 &elements);
65
77 int coe2rv(CartesianVector6 &elements,
78 double mu,
79 CartesianVector3 &pos,
80 CartesianVector3 &vel);
81
88 clockwerk::DCM dcmPqr2Xyz(double i, double W, double w);
89
102 int lvlhFrame(const CartesianVector3 &pos,
103 const CartesianVector3 &vel,
104 clockwerk::DCM &lvlh_frame,
105 CartesianVector3 &lvlh_ang_vel__lvlh);
106
107}
108
109#endif
Class defining a direction cosine matrix inherited from Matrix.
Definition DCM.h:69
#define CartesianVector3
Definition mathmacros.h:43
#define CartesianVector6
Definition mathmacros.h:45
Class to propagate CR3BP dynamics in characteristic units.
Definition statistics.hpp:22
int lvlhFrame(const CartesianVector3 &pos, const CartesianVector3 &vel, DCM &lvlh_frame, CartesianVector3 &lvlh_ang_vel__lvlh)
Function to generate an LVLH frame attitude DCM from position and velocity.
Definition orbitutils.cpp:131
DCM dcmPqr2Xyz(double i, double W, double w)
Function to generate a 3-1-3 DCM to rotate from PQR to XYZ coordinates.
Definition orbitutils.cpp:125
int rv2coe(const CartesianVector3 &pos, const CartesianVector3 &vel, double mu, CartesianVector6 &elements)
Function to convert cartesian xyz pos/vel to orbital elements.
Definition orbitutils.cpp:30
int true2eccentric(double true_anomaly, double eccentricity, double &eccentric_anomaly)
Function to convert true anomaly to eccentric anomaly.
Definition kepler.cpp:86
int coe2rv(CartesianVector6 &elements, double mu, CartesianVector3 &pos, CartesianVector3 &vel)
Function to convert orbital elements to cartesian xyz.
Definition orbitutils.cpp:91