net.jimmc.spelsim
Class Planet

java.lang.Object
  |
  +--net.jimmc.spelsim.Planet

public class Planet
extends java.lang.Object

A representation of a planet.


Constructor Summary
Planet()
          Create a planet object.
 
Method Summary
 double getDensity()
          Get the density of the planet based on its radius and mass.
 double getGravity()
          Get the surface gravity of the planet.
 double getMass()
          Get the mass of the planet.
 double getPeriod()
          Get the rotation period of the planet.
static Planet getPlanet(java.lang.String name)
          Get a planet with preset values.
static java.lang.String[] getPlanetNames()
          Get the list of known planet names.
 double getRadius()
          Get the radius of the planet.
 double getSynchronousAltitude()
          Get the altitude of synchronous orbit.
 void setMass(double mass)
          Set the mass of the planet.
 void setPeriod(double period)
          Set the rotation period of the planet.
 void setRadius(double radius)
          Set the radius of the planet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Planet

public Planet()
Create a planet object.

Method Detail

getPlanet

public static Planet getPlanet(java.lang.String name)
Get a planet with preset values.


getPlanetNames

public static java.lang.String[] getPlanetNames()
Get the list of known planet names.


setMass

public void setMass(double mass)
Set the mass of the planet.

Parameters:
mass - The mass of the planet in kg.

getMass

public double getMass()
Get the mass of the planet.

Returns:
The mass of the planet in kg.

setRadius

public void setRadius(double radius)
Set the radius of the planet.

Parameters:
radius - The radius of the planet in meters.

getRadius

public double getRadius()
Get the radius of the planet.

Returns:
The radius of the planet in meters.

setPeriod

public void setPeriod(double period)
Set the rotation period of the planet.

Parameters:
period - The rotation period of the planet in meters per second-squared.

getPeriod

public double getPeriod()
Get the rotation period of the planet.

Returns:
The rotation period of the planet in seconds.

getGravity

public double getGravity()
Get the surface gravity of the planet.

Returns:
The surface gravity of the planet in meters per second-squared.

getDensity

public double getDensity()
Get the density of the planet based on its radius and mass.


getSynchronousAltitude

public double getSynchronousAltitude()
Get the altitude of synchronous orbit.

Returns:
The height of synchronious orbit above the surface in meters.