WSF
WsfSpaceOrbitSize.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2020 Infoscitex, a DCS Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef WSFSPACEORBITSIZE_HPP
13#define WSFSPACEORBITSIZE_HPP
14
15#include "wsf_space_export.h"
16
17#include "UtEarth.hpp"
18#include "UtUnitTypes.hpp"
19
20namespace wsf
21{
22namespace space
23{
24
31class WSF_SPACE_EXPORT OrbitSize
32{
33public:
34 OrbitSize(UtLengthValue aSemiMajorAxis = UtLengthValue{1.0e-12, UtUnitLength::cKILOMETERS},
35 double aGravitationalParameter = UtEarth::cGRAVITATIONAL_PARAMETER);
36
38 const UtLengthValue& GetSemiMajorAxis() const { return mSemiMajorAxis; }
39
41 const UtLengthValue& GetCircularAltitude() const { return mCircularAlititude; }
42
44 const UtTimeValue& GetOrbitalPeriod() const { return mOrbitalPeriod; }
45
47 double GetRevolutionsPerDay() const { return mRevolutionsPerDay; }
48
49 void SetSemiMajorAxis(const UtLengthValue& aSemiMajorAxis);
50 void SetCircularAltitude(const UtLengthValue& aAltitude);
51 void SetOrbitalPeriod(const UtTimeValue& aPeriod);
52 void SetRevolutionsPerDay(double aRevolutionsPerDay);
53
55 bool SpecifiedAsSemiMajorAxis() const { return mInputType == InputType::cSEMI_MAJOR_AXIS; }
56
58 bool SpecifiedAsCircularAltitude() const { return mInputType == InputType::cCIRCULAR_ALTITUDE; }
59
61 bool SpecifiedAsOrbitalPeriod() const { return mInputType == InputType::cORBITAL_PERIOD; }
62
64 bool SpecifiedAsRevsPerDay() const { return mInputType == InputType::cREVS_PER_DAY; }
65
66 static OrbitSize FromSemiMajorAxis(UtLengthValue aSemiMajorAxis,
67 double aGravitationalParameter = UtEarth::cGRAVITATIONAL_PARAMETER);
68 static OrbitSize FromCircularAltitude(UtLengthValue aAltitude,
69 double aGravitationalParameter = UtEarth::cGRAVITATIONAL_PARAMETER);
70 static OrbitSize FromOrbitalPeriod(UtTimeValue aPeriod,
71 double aGravitationalParameter = UtEarth::cGRAVITATIONAL_PARAMETER);
72 static OrbitSize FromRevolutionsPerDay(double aRevolutionsPerDay,
73 double aGravitationalParameter = UtEarth::cGRAVITATIONAL_PARAMETER);
74
75private:
76 void AltitudeFromSMA();
77 void SMA_FromAltitude();
78 void PeriodFromSMA();
79 void SMA_FromPeriod();
80 void RevsFromPeriod();
81 void PeriodFromRevs();
82
83 enum InputType
84 {
85 cSEMI_MAJOR_AXIS,
86 cCIRCULAR_ALTITUDE,
87 cORBITAL_PERIOD,
88 cREVS_PER_DAY
89 };
90
91 UtLengthValue mSemiMajorAxis{0.0, UtUnitLength::cKILOMETERS};
92 UtLengthValue mCircularAlititude{0.0, UtUnitLength::cKILOMETERS};
93 UtTimeValue mOrbitalPeriod{0.0, UtUnitTime::cMINUTES};
94 double mRevolutionsPerDay{};
95 double mGravitationalParameter; // in SI units
96 InputType mInputType{InputType::cSEMI_MAJOR_AXIS};
97};
98
99} // namespace space
100} // namespace wsf
101
102#endif // WSFSPACEORBITSIZE_HPP
Definition WsfSpaceOrbitSize.hpp:32
OrbitSize(UtLengthValue aSemiMajorAxis=UtLengthValue{1.0e-12, UtUnitLength::cKILOMETERS}, double aGravitationalParameter=UtEarth::cGRAVITATIONAL_PARAMETER)
Definition WsfSpaceOrbitSize.cpp:25
const UtTimeValue & GetOrbitalPeriod() const
Return the orbital period.
Definition WsfSpaceOrbitSize.hpp:44
double GetRevolutionsPerDay() const
Return the number of revolutions per day of the orbit.
Definition WsfSpaceOrbitSize.hpp:47
bool SpecifiedAsOrbitalPeriod() const
Return if the orbit size was specified using the orbital period.
Definition WsfSpaceOrbitSize.hpp:61
bool SpecifiedAsCircularAltitude() const
Return if the orbit size was specified using the circular altitude.
Definition WsfSpaceOrbitSize.hpp:58
bool SpecifiedAsRevsPerDay() const
Return if the orbit size was specified using the number of revolutions per day.
Definition WsfSpaceOrbitSize.hpp:64
const UtLengthValue & GetCircularAltitude() const
Return the circular altitude of the orbit.
Definition WsfSpaceOrbitSize.hpp:41
const UtLengthValue & GetSemiMajorAxis() const
Return the semi-major axis of the orbit.
Definition WsfSpaceOrbitSize.hpp:38
bool SpecifiedAsSemiMajorAxis() const
Return if the orbit size was specified using the semi-major axis.
Definition WsfSpaceOrbitSize.hpp:55
Definition WsfAtmosphere.cpp:23
Function definitions for those who need run-time access to the version.
Definition WsfComm.cpp:32
Copyrights Multiple, All Rights Reserved