/*
 * Support functions.
 * By Dave Pearson <davep@davep.org>
 */

function Diameters()
{
   this.Sol     = 1390000,
   this.Mercury = 4880,
   this.Venus   = 12103,
   this.Earth   = 12756,
   this.Luna    = 3476,
   this.Mars    = 6794,
   this.Jupiter = 142984,
   this.Saturn  = 120536,
   this.Uranus  = 51118,
   this.Neptune = 49532,
   this.Pluto   = 2274
};

function emitDiameterOptions()
{
   var o = new Diameters();

   for ( var body in o )
   {
      document.writeln( "<option value=\"" + o[ body ] + "\">" + body + "</option>" );
   }
}

function StringifyFloat( f, dp )
{
   var m = Math.pow( 10, dp );
   return parseInt( f * m, 10 ) / m;
}

function degToRad( angle )
{
   return ( angle * Math.PI ) / 180;
}
