Difference between revisions of "Template:OrbitAltitude/Core"

From Kerbal Space Program Wiki
Jump to: navigation, search
m (+allow formulas for the period parameter;)
m (Use new mass template)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{#expr:((({{{1}}})^2 * {{G}} * {{{2}}}/(4 * pi^2)) ^ (1/3)) - {{{3|0}}}}}</includeonly><noinclude>Calcuates the orbital height without any formatting.
+
<includeonly>{{#expr:(((({{#if: {{{1|}}}{{#if: {{{b|}}}||1}}|{{{1}}}|{{Body data|{{{b}}}|sidrot}}}}{{#if: {{{pf|}}}|*{{{pf}}}}})^2 * {{G}} * {{#if: {{{2|}}}{{#if: {{{b|}}}||1}}|{{{2}}}|{{Body data/Mass|{{{b}}}}}}}/(4 * pi^2)) ^ (1/3)) - {{#if: {{{3|}}}{{#if: {{{b|}}}||1}}|{{#if: {{{3|}}}|{{{3}}}|0}}|{{Body data|{{{b}}}|radius}}}}) {{#switch: {{{f|}}}
 +
|k=/1000
 +
|M=/1000000
 +
|G=/1000000000}}}}</includeonly><noinclude>Calculates the orbital height without any formatting.
  
{| class="wikitable"
+
{{Parameter table|parameters=
! #
+
{{Parameter row|1|Period of the orbit in seconds}}
! Description
+
{{Parameter row|2|Mass of central body in kilograms}}
|-
+
{{Parameter row|3|Radius of central body in meters|0}}
| 1
+
{{Parameter row|f|Factor in which the altitude should be shown. Available values: None (m), '''k''' (km), '''M''' (Mm), '''G''' (Gm). If the radius was given kilometers it uses the factor '''k'''.|None}}
| Period (s)
+
{{Parameter row|b|Uses the sidereal rotation period, mass and radius as default from the given body. Can be overwritten.|Not set (makes the first three parameters mandatory)}}
|-
+
{{Parameter row|pf|2=Multiplies the period with this value. Useful to easily calculate semi-synchronous orbits (<tt>pf=1/2</tt> then).|3=<tt>1</tt>}}
| 2
+
}}
| Mass (kg)
 
|-
 
| 3
 
| Radius (m), Default is 0 m.
 
|}
 
  
[[Category:Templates|OrbitAltitude/Core]]</noinclude>
+
[[Category:Templates]]</noinclude>

Latest revision as of 13:01, 10 May 2018

Calculates the orbital height without any formatting.

# Optional Description Default
1 No Period of the orbit in seconds
2 No Mass of central body in kilograms
3 Yes Radius of central body in meters 0
f Yes Factor in which the altitude should be shown. Available values: None (m), k (km), M (Mm), G (Gm). If the radius was given kilometers it uses the factor k. None
b Yes Uses the sidereal rotation period, mass and radius as default from the given body. Can be overwritten. Not set (makes the first three parameters mandatory)
pf Yes Multiplies the period with this value. Useful to easily calculate semi-synchronous orbits (pf=1/2 then). 1