Difference between revisions of "Template:OrbitVelocity"

From Kerbal Space Program Wiki
Jump to: navigation, search
(*upgrade to make it similar to OrbitAltitude;)
Line 1: Line 1:
{{#expr: <!--
+
<includeonly>{{formatnum|{{#expr: {{OrbitVelocity/Core|{{{1|{{{period|{{{period_s}}}}}}}}}|{{{2|{{{mass|{{{mass_kg}}}}}}}}}}} {{#switch: {{{factor|}}}
-->    ( <!--
+
|k=/1000
-->        {{G}} * {{{mass_kg}}} / {{OrbitAltitude/Core|{{{period_s}}}|{{{mass_kg}}}|0}} <!--
+
|M=/1000000
-->    ) ^ 0.5 <!--
+
|G=/1000000000}}}}|2}}&nbsp;{{Dict|{{{factor|}}}}}{{Dict|m}}/{{Dict|s}}}}{{#if: {{{period_s|}}}{{{mass_kg|}}}{{{round|}}}{{{suffix|}}}|[[Category:OrbitVelocity with old parameters]]}}</includeonly><noinclude>This template calculates the velocity of an orbit. To calculate further with the orbit's velocity use {{Tl|OrbitVelocity/Core}}. To add the mass, and possibly the period, automatically the {{Tl|BodyData/Orbit velocity}} can be used.
--> {{{round|}}} }} {{{suffix|{{lang|en=m/s|ru=м/с}}}}}<noinclude>
 
  
 +
All usages with the old parameter names will be sorted into the category [[:Category:OrbitVelocity with old parameters]].
 +
 +
== Parameters ==
 +
 +
{{Parameter Table|name=both|parameters=
 +
{{Parameter Row|period|name2=1|Period of the orbit in seconds (Old parametername: <tt>{{{period_s}}}</tt>)}}
 +
{{Parameter Row|mass|name2=2|Mass of central body in kilograms (Old parametername: <tt>{{{mass_kg}}}</tt>)}}
 +
{{Parameter Row|factor|Factor in which the velocity should be shown. Available values: None (m/s), '''k''' (km/s), '''M''' (Mm/s), '''G''' (Gm/s).|None}}
 +
}}
 +
 +
== Examples ==
 
{| class="wikitable"
 
{| class="wikitable"
 
! Usage || Produces
 
! Usage || Produces
 
|-
 
|-
| <pre><nowiki>{{OrbitVelocity | period_s=64980 | mass_kg=4.515e21}}</nowiki></pre> || {{OrbitVelocity | period_s=64980 | mass_kg=4.515e21}}
+
| <pre><nowiki>{{OrbitVelocity | period=64980 | mass=4.515e21}}</nowiki></pre> || {{OrbitVelocity | period=64980 | mass=4.515e21}}
 
|-
 
|-
| <pre><nowiki>{{OrbitVelocity | period_s=64980 | mass_kg=4.515e21 | round=round2}}</nowiki></pre> || {{OrbitVelocity | period_s=64980 | mass_kg=4.515e21 | round=round2}}
+
| <pre><nowiki>{{OrbitVelocity | 64980 | 4.515e21}}</nowiki></pre> || {{OrbitVelocity | 64980 | 4.515e21}}
|-
 
| <pre><nowiki>{{OrbitVelocity | period_s=64980 | mass_kg=4.515e21 | round=round2 | suffix=}}</nowiki></pre> || {{OrbitVelocity | period_s=64980 | mass_kg=4.515e21 | round=round2 | suffix=}}
 
 
|}
 
|}
  
This template calculates the velocity of an orbit, given the mass of the planet (in kg) and the period of the orbit (in seconds).
+
[[Category:Templates]]</noinclude>
 
 
[[Category:Templates|OrbitVelocity]]
 
</noinclude>
 

Revision as of 13:24, 15 September 2013

This template calculates the velocity of an orbit. To calculate further with the orbit's velocity use {{OrbitVelocity/Core}}. To add the mass, and possibly the period, automatically the {{BodyData/Orbit velocity}} can be used.

All usages with the old parameter names will be sorted into the category Category:OrbitVelocity with old parameters.

Parameters

Template:Parameter Table

Examples

Usage Produces
{{OrbitVelocity | period=64980 | mass=4.515e21}}
307.72 m/s
{{OrbitVelocity | 64980 | 4.515e21}}
307.72 m/s