net.jimmc.spelsim
Class Planet

java.lang.Object
  extended by 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
 void draw(java.awt.Graphics2D g, double scale)
          Draw our planet at the specified scale, and time.
 DVector getBase()
          Get the position of the base station.
 DVector getBase(double simOffset)
          Get a future position of the base station.
 double getBaseTheta()
          Get the theta coordiate of the base station.
 DVector getBaseVelocity()
          Get the current velocity of the base station.
 DVector getBaseVelocity(double simOffset)
          Get a future velocity of the base station.
 double getDensity()
          Get the density of the planet based on its radius and mass.
 double getGravity()
          Get the surface gravity of the planet.
 DVector getGroundVelocity(DVector g)
          Get the velocity of the surface of the planet at the given point.
 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 getPrimeAngle()
          Get the current rotation angle of the prime meridian.
 double getRadius()
          Get the radius of the planet.
 double getSynchronousAltitude()
          Get the altitude of synchronous orbit.
protected  void resetSimulation()
          Reset the simulation.
 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.
protected  void simulateOneStep(double simInterval)
          Simulate a time change of the specified amount.
 
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.

getPrimeAngle

public double getPrimeAngle()
Get the current rotation angle of the prime meridian. The rotation at time zero is defined to be zero.

Returns:
The counterclockwise rotation in radians.

resetSimulation

protected void resetSimulation()
Reset the simulation.


simulateOneStep

protected void simulateOneStep(double simInterval)
Simulate a time change of the specified amount.


getBase

public DVector getBase()
Get the position of the base station.


getBase

public DVector getBase(double simOffset)
Get a future position of the base station.


getBaseVelocity

public DVector getBaseVelocity()
Get the current velocity of the base station.


getBaseVelocity

public DVector getBaseVelocity(double simOffset)
Get a future velocity of the base station.


getGroundVelocity

public DVector getGroundVelocity(DVector g)
Get the velocity of the surface of the planet at the given point. We ignore the radius and just take the angle of the point, then return the velocity of the planet surface at that angle.


getBaseTheta

public double getBaseTheta()
Get the theta coordiate of the base station.


draw

public void draw(java.awt.Graphics2D g,
                 double scale)
Draw our planet at the specified scale, and time.