Skip to content

Instantly share code, notes, and snippets.

@ExtReMLapin
Last active March 31, 2019 16:30
Show Gist options
  • Save ExtReMLapin/1d881334f925e542ceac7f322a79ef9b to your computer and use it in GitHub Desktop.
Save ExtReMLapin/1d881334f925e542ceac7f322a79ef9b to your computer and use it in GitHub Desktop.
class Program
{
private const double mu = 398600.4418;
private static void printDatasSats(double meanMotion, double excentricity)
{
double SemiMajorAxis = Math.Pow(mu / Math.Pow(meanMotion * (double)2 * Math.PI / 86400, (double)2), (double)((double)1 / (double)3));
double Apoapsis = (SemiMajorAxis * ((double)1 + excentricity)) - 6378.135;
double Periapsis = (SemiMajorAxis * ((double)1 - excentricity)) - 6378.135;
Console.WriteLine(string.Format("SemiMajorAxis = {0}\nApoapsis = {1}\nPeriapsis = {2}", SemiMajorAxis, Apoapsis, Periapsis));
}
/*
* 1 25544U 98067A 19029.92277616 .00001044 00000-0 23727-4 0 9995
* 2 25544 51.6423 328.8640 0004868 330.0424 140.1326 15.53206111153771
*
* MeanMotion = 15.53206111
* Excentricity = 0.0004868
*/
static void Main(string[] args)
{
printDatasSats(15.53206111, 0.0004868);
/*
* It outputs
* SemiMajorAxis = 6785.50926153916
* Apoapsis = 410.677447447682 km
* Periapsis = 404.071075630646 km
*/
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment