Difference between revisions of "Template:OrbitAltitude"

From Kerbal Space Program Wiki
Jump to: navigation, search
(+Use Template:Formatnum with automatic decimal separator usage;)
m (!divide to get from m to km;)
Line 1: Line 1:
<includeonly>{{formatnum|{{#expr:((({{{period_s}}}^2 * {{G}} * {{{mass_kg}}}/(4 * pi^2)) ^ (1/3)) {{#if: {{{radius_km|}}}|*1000}} - {{#if: {{{radius_km|}}}|{{{radius_km}}}|{{{radius_m}}}}}}}|2}}{{#if: {{{suffix|}}}|&nbsp;{{#if: {{{radius_km|}}}|km|m}}}}</includeonly><noinclude>
+
<includeonly>{{formatnum|{{#expr:((({{{period_s}}}^2 * {{G}} * {{{mass_kg}}}/(4 * pi^2)) ^ (1/3)) {{#if: {{{radius_km|}}}|/1000}} - {{#if: {{{radius_km|}}}|{{{radius_km}}}|{{{radius_m}}}}}}}|2}}{{#if: {{{suffix|}}}|&nbsp;{{#if: {{{radius_km|}}}|km|m}}}}</includeonly><noinclude>
  
 
{| class="wikitable"
 
{| class="wikitable"

Revision as of 19:40, 6 April 2013


Usage Produces
{{OrbitAltitude | period_s=64980 | mass_kg=4.515e21 | radius_km=320}}
0.00 m
{{OrbitAltitude | period_s=64980 | mass_kg=4.515e21 | radius_m=320000}}
0.00 m

This template calculates the altitude of an orbit, given the mass of the planet (in kg), the planet's radius (in km or m), and the period of the orbit (in seconds).