Difference between revisions of "Template:Infobox/Body"

From Kerbal Space Program Wiki
Jump to: navigation, search
m (!detailed orbital period should work now;)
Line 22: Line 22:
 
{{PlanetBoxRow|[[w:Mean_Anomaly|Mean Anomaly]]                |{{{anomaly|??}}}|°}}
 
{{PlanetBoxRow|[[w:Mean_Anomaly|Mean Anomaly]]                |{{{anomaly|??}}}|°}}
 
{{PlanetBoxRow|[[w:Orbital_Period|Orbital Period]]            |{{sigfigs| {{{orbps}}} |8}} s |}}
 
{{PlanetBoxRow|[[w:Orbital_Period|Orbital Period]]            |{{sigfigs| {{{orbps}}} |8}} s |}}
|-
+
{{!}}-
| colspan="2" style="text-align: left;" | <small>{{#ifexpr: 156992040 > 86400|{{formatnum: {{#expr: trunc(156992040 / 86400)}}}} d|}} {{#ifexpr: 156992040 > 3600|{{#expr: 156992040 / 3600 mod 24}} h|}} {{#ifexpr: 156992040 > 60|{{#expr: 156992040 / 60 mod 60}} m|}} {{#expr: 156992040 mod 60}} s</small>
+
{{!}}{{!}} {{!}}{{!}} <small>{{#ifexpr: {{{orbps}}} > 86400|{{formatnum: {{#expr: trunc({{{orbps}}} / 86400)}}}} d|}} {{#ifexpr: {{{orbps}}} > 3600|{{#expr: {{{orbps}}} / 3600 mod 24}} h|}} {{#ifexpr: {{{orbps}}} > 60|{{#expr: {{{orbps}}} / 60 mod 60}} m|}} {{#expr: {{{orbps}}} mod 60}} s</small>
 
{{PlanetBoxRow|[[w:Orbital_speed|Orbital Velocity]]        |{{#ifeq: {{{apoap|}}}|{{{periap|{{{apoap|}}}}}}|{{#expr: 2*pi*{{{apoap}}}/{{{orbps}}} round 1}}|{{formatnum: {{#expr: pi*({{{apoap}}}+{{{periap}}})/{{{orbps}}}*({{{periap}}}/{{{apoap}}})^(0.5) round 1}}}} to {{formatnum: {{#expr: pi*({{{apoap}}}+{{{periap}}})/{{{orbps}}}*({{{apoap}}}/{{{periap}}})^(0.5) round 1}}}}}}  |m/s}}|
 
{{PlanetBoxRow|[[w:Orbital_speed|Orbital Velocity]]        |{{#ifeq: {{{apoap|}}}|{{{periap|{{{apoap|}}}}}}|{{#expr: 2*pi*{{{apoap}}}/{{{orbps}}} round 1}}|{{formatnum: {{#expr: pi*({{{apoap}}}+{{{periap}}})/{{{orbps}}}*({{{periap}}}/{{{apoap}}})^(0.5) round 1}}}} to {{formatnum: {{#expr: pi*({{{apoap}}}+{{{periap}}})/{{{orbps}}}*({{{apoap}}}/{{{periap}}})^(0.5) round 1}}}}}}  |m/s}}|
 
}}
 
}}

Revision as of 20:39, 18 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

It will also calculate the Atmospheric Pressure from atm to kPa and vice versa. If the periapsis isn't defined it will assume a circular orbit where the apoapsis is identical to the periapsis.

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

Template

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

Example

Example used on this page:

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