Difference between revisions of "Template:OrbitVelocity"

From Kerbal Space Program Wiki
Jump to: navigation, search
(Add optional "round" and "suffix" arguments.)
(-radius_km isn't needed; +use OrbitAltitude/Core;)
Line 1: Line 1:
 
{{#expr: <!--
 
{{#expr: <!--
 
-->    ( <!--
 
-->    ( <!--
-->        {{G}} * {{{mass_kg}}} / <!--
+
-->        {{G}} * {{{mass_kg}}} / {{OrbitAltitude/Core|{{{period_s}}}|{{{mass_kg}}}|0}}
-->        ( <!--
 
-->            ( <!--
 
-->                {{{period_s}}}^2 * {{G}} * {{{mass_kg}}} <!--
 
-->                / (4 * pi^2) <!--
 
-->            ) ^ (1/3) <!--
 
-->        ) <!--
 
 
-->    ) ^ 0.5 <!--
 
-->    ) ^ 0.5 <!--
 
--> {{{round|}}} }} {{{suffix|m/s}}}<noinclude>
 
--> {{{round|}}} }} {{{suffix|m/s}}}<noinclude>
Line 14: Line 8:
 
! Usage || Produces
 
! Usage || Produces
 
|-
 
|-
| <pre><nowiki>{{OrbitVelocity | period_s=64980 | mass_kg=4.515e21 | radius_km=320}}</nowiki></pre> || {{OrbitVelocity | period_s=64980 | mass_kg=4.515e21 | radius_km=320}}
+
| <pre><nowiki>{{OrbitVelocity | period_s=64980 | mass_kg=4.515e21}}</nowiki></pre> || {{OrbitVelocity | period_s=64980 | mass_kg=4.515e21}}
 
|-
 
|-
| <pre><nowiki>{{OrbitVelocity | period_s=64980 | mass_kg=4.515e21 | radius_km=320 | round=round2}}</nowiki></pre> || {{OrbitVelocity | period_s=64980 | mass_kg=4.515e21 | radius_km=320 | round=round2}}
+
| <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 | period_s=64980 | mass_kg=4.515e21 | radius_km=320 | round=round2 | suffix=}}</nowiki></pre> || {{OrbitVelocity | period_s=64980 | mass_kg=4.515e21 | radius_km=320 | round=round2 | suffix=}}
+
| <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), the planet's radius (in km), and the period of the orbit (in seconds).
+
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|OrbitVelocity]]
 
[[Category:Templates|OrbitVelocity]]
 
</noinclude>
 
</noinclude>

Revision as of 19:21, 22 April 2013

Expression error: Unrecognized punctuation character "{". m/s

Usage Produces
{{OrbitVelocity | period_s=64980 | mass_kg=4.515e21}}
0.00 m/s
{{OrbitVelocity | period_s=64980 | mass_kg=4.515e21 | round=round2}}
0.00 m/s
{{OrbitVelocity | period_s=64980 | mass_kg=4.515e21 | round=round2 | suffix=}}
0.00 m/s

This template calculates the velocity of an orbit, given the mass of the planet (in kg) and the period of the orbit (in seconds).