Difference between revisions of "Template:Infobox/Body"

From Kerbal Space Program Wiki
Jump to: navigation, search
Line 42: Line 42:
 
|-
 
|-
 
| [[w:Mass|Mass]]
 
| [[w:Mass|Mass]]
| {{sigfigs|{{{mass}}}|8}} kg
+
| {{sigfigs|{{CelestialBodyMass|{{{Name|{{PAGENAME}}}}}}}|8}} kg
 
|-
 
|-
 
| [[w:Standard gravitational parameter|Gravitational Parameter]]
 
| [[w:Standard gravitational parameter|Gravitational Parameter]]
| {{sigfigs|{{#expr: {{{mass}}} * {{G}}}}|8}} m<sup>3</sup>/s<sup>2</sup>
+
| {{sigfigs|{{#expr: {{CelestialBodyMass|{{{Name|{{PAGENAME}}}}}}} * {{G}}}}|8}} m<sup>3</sup>/s<sup>2</sup>
 
|-
 
|-
 
| [[w:Density|Density]]
 
| [[w:Density|Density]]
| {{sigfigs|{{#expr: {{{mass}}} / (4 * pi * {{{radius}}}^3 / 3)}}|8}} kg/m<sup>3</sup>
+
| {{sigfigs|{{#expr: {{CelestialBodyMass|{{{Name|{{PAGENAME}}}}}}} / (4 * pi * {{{radius}}}^3 / 3)}}|8}} kg/m<sup>3</sup>
 
|-
 
|-
 
| [[w:Surface_gravity|Surface Gravity]]
 
| [[w:Surface_gravity|Surface Gravity]]
| {{sigfigs|{{#expr: {{{mass}}} * {{G}} / ({{{radius}}}^2)}}|3}} m/s<sup>2</sup>
+
| {{sigfigs|{{#expr: {{CelestialBodyMass|{{{Name|{{PAGENAME}}}}}}} * {{G}} / ({{{radius}}}^2)}}|3}} m/s<sup>2</sup>
 
{{PlanetBoxRow|[[w:Escape_velocity|Escape Velocity]]                  <!--
 
{{PlanetBoxRow|[[w:Escape_velocity|Escape Velocity]]                  <!--
-->    |{{#expr: (2 * {{G}} * {{{mass|0}}} / {{{radius|1}}})^0.5 round2 }}|m/s}}
+
-->    |{{#expr: (2 * {{G}} * {{CelestialBodyMass|{{{Name|{{PAGENAME}}}}}}} / {{{radius|1}}})^0.5 round2 }}|m/s}}
 
{{PlanetBoxRow|[[w:Rotation_period|Sidereal Rotation Period]]        |{{sigfigs|{{{sidrot}}}|8}}|s}}
 
{{PlanetBoxRow|[[w:Rotation_period|Sidereal Rotation Period]]        |{{sigfigs|{{{sidrot}}}|8}}|s}}
 
{{!}}-
 
{{!}}-
 
{{!}}{{!}} {{!}}{{!}} <small>{{ExpandTime|{{{sidrot}}}}}</small>
 
{{!}}{{!}} {{!}}{{!}} <small>{{ExpandTime|{{{sidrot}}}}}</small>
 
{{PlanetBoxRow|[[w:Sidereal_time|Sidereal Rotational Velocity]]      |{{sigfigs|{{#expr: {{{radius}}} * 2 * pi / {{{sidrot}}}}}|5}}|m/s}}
 
{{PlanetBoxRow|[[w:Sidereal_time|Sidereal Rotational Velocity]]      |{{sigfigs|{{#expr: {{{radius}}} * 2 * pi / {{{sidrot}}}}}|5}}|m/s}}
{{PlanetBoxRow|[[w:Synchronous_orbit|Synchronous Orbit]]              |{{#if: {{#ifeq: {{{SoI}}}|∞|1}}{{#ifexpr: {{OrbitAltitude | radius_m={{{radius}}} | mass_kg={{{mass}}} | period_s={{{sidrot}}} | suffix= }} < {{{SoI}}}|1}}|{{sigfigs|{{OrbitAltitude | radius_m={{{radius}}} | mass_kg={{{mass}}} | period_s={{{sidrot}}} | suffix=  }}|8}} m|Outside sphere of influence}}}}
+
{{PlanetBoxRow|[[w:Synchronous_orbit|Synchronous Orbit]]              |{{#if: {{#ifeq: {{{SoI}}}|∞|1}}{{#ifexpr: {{OrbitAltitude | radius_m={{{radius}}} | mass_kg={{CelestialBodyMass|{{{Name|{{PAGENAME}}}}}}} | period_s={{{sidrot}}} | suffix= }} < {{{SoI}}}|1}}|{{sigfigs|{{OrbitAltitude | radius_m={{{radius}}} | mass_kg={{CelestialBodyMass|{{{Name|{{PAGENAME}}}}}}} | period_s={{{sidrot}}} | suffix=  }}|8}} m|Outside sphere of influence}}}}
 
|-
 
|-
 
| [[w:Sphere_of_influence_(astrodynamics)|Sphere of Influence]]
 
| [[w:Sphere_of_influence_(astrodynamics)|Sphere of Influence]]
Line 95: Line 95:
 
|anomaly=4.2
 
|anomaly=4.2
 
|radius=10000
 
|radius=10000
|mass=1e20
 
 
|sidrot=3600
 
|sidrot=3600
 
|SoI=200000
 
|SoI=200000
Line 118: Line 117:
 
* Atmospheric pressure (in atm): Atmospheric pressure (in kPa)
 
* Atmospheric pressure (in atm): Atmospheric pressure (in kPa)
  
If the periapsis isn't defined it will assume a circular orbit where the apoapsis is identical to the periapsis.
+
If the periapsis isn't defined it will assume a circular orbit where the apoapsis is identical to the periapsis. For the mass it uses <nowiki>{{</nowiki>[[Template:CelestialBodyMass|CelestialBodyMass]]<nowiki>}}</nowiki>
  
 
To deactivate orbital information (for example [[Kerbol]]) don't set <tt><nowiki>{{{Parent}}}</nowiki></tt>. The atmospheric information can be hidden when <tt><nowiki>{{{atmosyorn}}}</nowiki></tt> is set to <tt>No</tt>. On all other values it will show the atmospheric entries.
 
To deactivate orbital information (for example [[Kerbol]]) don't set <tt><nowiki>{{{Parent}}}</nowiki></tt>. The atmospheric information can be hidden when <tt><nowiki>{{{atmosyorn}}}</nowiki></tt> is set to <tt>No</tt>. On all other values it will show the atmospheric entries.
Line 127: Line 126:
 
! Optional
 
! Optional
 
! Description
 
! Description
 +
|-
 +
| <tt>Name</tt>
 +
| Yes
 +
| Name of celestial body. Used to determine mass. Default: <nowiki>{{PAGENAME}}</nowiki>
 
|-
 
|-
 
| <tt>Class</tt>
 
| <tt>Class</tt>
 
| No
 
| No
| Class of celestial object: [[Star]], [[Planet]], [[Dwarf Planet]] or [[Moon]]
+
| Class of celestial body
 
|-
 
|-
 
| <tt>File</tt>
 
| <tt>File</tt>
Line 159: Line 162:
 
| No
 
| No
 
| Radius in meters
 
| Radius in meters
|-
 
| <tt>mass</tt>
 
| No
 
| Mass in kilograms
 
 
|-
 
|-
 
| <tt>sidrot</tt>
 
| <tt>sidrot</tt>
Line 211: Line 210:
 
|anomaly=??
 
|anomaly=??
 
|radius=??
 
|radius=??
|mass=??
 
 
|sidrot=??
 
|sidrot=??
 
|SoI=??
 
|SoI=??
Line 225: Line 223:
 
== Example ==
 
== Example ==
 
Example used on this page:
 
Example used on this page:
<pre><nowiki>
+
<pre>{{Planetbox
{{Planetbox
 
 
|Class=Planet
 
|Class=Planet
 
|File=Image-needed.png
 
|File=Image-needed.png
Line 236: Line 233:
 
|orbps=36000
 
|orbps=36000
 
|radius=10000
 
|radius=10000
|mass=1e20
 
 
|sidrot=3600
 
|sidrot=3600
 
|SoI=200000
 
|SoI=200000
Line 246: Line 242:
 
|T-maxC=47
 
|T-maxC=47
 
|O2yorn=no
 
|O2yorn=no
}}</nowiki></pre>
+
}}</pre>
  
 
[[Category:Templates|Planetbox]]
 
[[Category:Templates|Planetbox]]
 
</noinclude>
 
</noinclude>

Revision as of 11:04, 21 February 2013

Template:Planetbox

Dependencies

Some values are calculated automatically:

  • Periapsis: Semi-major axis, Orbital eccentricity, Orbital velocity
  • Apoapsis: Semi-major axis, Orbital eccentricity, Orbital velocity
  • Orbital period: Orbital velocity
  • Radius: Surface Area, Density, Surface Gravity, Synchronous Orbit
  • Mass: Gravitational Parameter, Density, Surface Gravity, Synchronous Orbit
  • Sidereal Rotation Period: Sidereal Rotational Velocity, Synchronous Orbit
  • Scale Height: Atmospheric Height
  • Atmospheric pressure (in atm): Atmospheric pressure (in kPa)

If the periapsis isn't defined it will assume a circular orbit where the apoapsis is identical to the periapsis. For the mass it uses {{CelestialBodyMass}}

To deactivate orbital information (for example Kerbol) don't set {{{Parent}}}. The atmospheric information can be hidden when {{{atmosyorn}}} is set to No. On all other values it will show the atmospheric entries.

Parameters

Name Optional Description
Name Yes Name of celestial body. Used to determine mass. Default: {{PAGENAME}}
Class No Class of celestial body
File No Filename to image of the celestial object
Parent Yes Object which this object does orbit. If net set it hides the orbital information. Default: Not set
apoap No Apoapsis in meters
periap Yes Periapsis in meters. Default: Apoapsis
orbinc No Orbital inclination in degrees.
anomaly No Mean anomaly in degrees
radius No Radius in meters
sidrot No Siderial period in seconds
SoI No Sphere of influence in meters. Special value: ∞
highest Yes Highest elevation in meters. Default: Not set
atmosyorn Yes Does this celestial object have a atmosphere? No to hide. Default: Yes
atmosatm No Atmospheric pressure in atm.
atmossh No Atmospheric scale height in meters
T-minC No Lowest temperature in degrees celsius
T-maxC No Highest temperature in degrees celsius
O2yorn No Is oxygen present?

Template

{{Planetbox
|Class=??
|File=??
|Parent=?? 
|apoap=??
|periap=??
|orbinc=??
|anomaly=??
|radius=??
|sidrot=??
|SoI=??
|highest=??
|atmosyorn=??
|atmosatm=??
|atmossh=??
|T-minC=??
|T-maxC=??
|O2yorn=??
}}

Example

Example used on this page:

{{Planetbox
|Class=Planet
|File=Image-needed.png
|Parent=Gilly
|apoap=1337000
|periap=470000
|orbinc=7.4
|anomaly=4.2
|orbps=36000
|radius=10000
|sidrot=3600
|SoI=200000
|highest=2357
|atmosyorn=yes
|atmosatm=1
|atmossh=3000
|T-minC=-42
|T-maxC=47
|O2yorn=no
}}