Difference between revisions of "Template:OrbitAltitude/Core"

From Kerbal Space Program Wiki
Jump to: navigation, search
m (!parameter table;)
m (Use new mass template)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<includeonly>{{#expr:(((({{#if: {{{1|}}}{{#if: {{{b|}}}||1}}|{{{1}}}|{{BodyData|{{{b}}}|sidrot}}}}{{#if: {{{pf|}}}|*{{{pf}}}}})^2 * {{G}} * {{#if: {{{2|}}}{{#if: {{{b|}}}||1}}|{{{2}}}|{{BodyData|{{{b}}}|mass}}}}/(4 * pi^2)) ^ (1/3)) - {{#if: {{{3|}}}{{#if: {{{b|}}}||1}}|{{#if: {{{3|}}}|{{{3}}}|0}}|{{BodyData|{{{b}}}|radius}}}}) {{#switch: {{{factor|}}}
+
<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
 
|k=/1000
 
|M=/1000000
 
|M=/1000000
 
|G=/1000000000}}}}</includeonly><noinclude>Calculates the orbital height without any formatting.
 
|G=/1000000000}}}}</includeonly><noinclude>Calculates the orbital height without any formatting.
  
{{Parameter Table|parameters=
+
{{Parameter table|parameters=
{{Parameter Row|1|Period of the orbit in seconds}}
+
{{Parameter row|1|Period of the orbit in seconds}}
{{Parameter Row|2|Mass of central body in kilograms}}
+
{{Parameter row|2|Mass of central body in kilograms}}
{{Parameter Row|3|Radius of central body in meters|0}}
+
{{Parameter row|3|Radius of central body in meters|0}}
{{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}}
+
{{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}}
{{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|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>}}
+
{{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>}}
 
}}
 
}}
  
 
[[Category:Templates]]</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