Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Channels ▼
RSS

Orbit Propagation


May 1991/Orbit Propagation/Listing 1

Listing 1

// Defines for all functions in this article.

#define PI     3.141592654
#define TWOPI (2*PI)
#define RTD (180/PI)
#define DTR (PI/180)

// All code was written in MSC 5.1 under PC-DOS.

// Units used: km for position, km/s for vel
//             angle (i,lan,w,M,E,nu) units: deg
// Value of earth mu used: 398600.8 km**3/s**2

// FUNCTION k2ce()
// This routine converts classical Keplerian elements to
//  Cartesian position and velocity.
//  Input : k[6] -- a, e, i, lan, w, m
//          mu  -- mu of central body ;
//  Output: c[6] -- x, y, z, xdot, ydot, zdot

  k2c  (double *k, double mu, double *c)

<B>Sample Input/Output</B>

A     7378.14 E 0.10 I 30.00      X  6640.32 Y 0.00 Z 0.00
LAN      0.00 W 0.00 M 0.00       XD    0.00 YD 7.03 ZD 4.06

// FUNCTION c2ke()
// This routine converts Cartesian position and velocity
//  to classical Keplerian elements, for elliptical
//  orbits.

//  Input : c[6] -- pos/vel;
//          mu -- mu of central body
//  Output: k[6] -- a,e,i,lan,w,m
//          ** i,lan,w,M are output in degrees **

<B>Sample Input/Output</B>

Outputs from k2ce() were input; the output reproduced
the k2ce() input.

Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.