main.js
/* ****************************************************************************
 *  preset Combo Box
 *  Notes: cb must not be a number, cb === 1 does not work
 *  I use 365 and not 365.2, this is to keep the numbers whole,
 *  in reality this an average and not the actual speed,
 *  this calculation needs a Maximum, Minimum and Current,
 *  set useJulianDays to 1 to change this to Julian days.
 */
preset Combo Box
Notes: cb must not be a number, cb === 1 does not work
I use 365 and not 365.2, this is to keep the numbers whole,
in reality this an average and not the actual speed,
this calculation needs a Maximum, Minimum and Current,
set useJulianDays to 1 to change this to Julian days.
preset Combo Box Notes : cb must not be a number cb === 1 does not work I use 365 and not 365 . 2 this is to keep the numbers whole in reality this an average and not the actual speed this calculation needs a Maximum Minimum and Current set useJulianDays to 1 to change this to Julian days .
function presetCB(cb) {
    "use strict";
    var useJulianDays = 0;
    var earthYearInDays = 365;
    if (useJulianDays === 1) {
        earthYearInDays = 365.256;
    }
    var cb_diameter_miles         = 7926.2109;
    var cb_sidereal_day           = 0.99726968;
    var cb_orbital_period_days    = earthYearInDays;  
    var cb_orbital_distance_miles = 584000000;
    if (cb === "1") {
        cb_diameter_miles         = 864575.9; 
        cb_sidereal_day           = 25.379995;
        cb_orbital_distance_miles = (2 * 161057496139894200) * Math.PI; 
        cb_orbital_period_days    = 242000000 * earthYearInDays;  
    }
    if (cb === "2") {
        cb_diameter_miles         = 3031.9186;
        cb_sidereal_day           = 58.646225;
        cb_orbital_distance_miles = 223700000;
        cb_orbital_period_days    = 87.97;
    }
    if (cb === "3") {
        cb_diameter_miles         = 7521.0769;
        cb_sidereal_day           = 243.0187;
        cb_orbital_distance_miles = 422500000;
        cb_orbital_period_days    = 224.7;
    }
    if (cb === "4") {
        cb_diameter_miles         = 7926.2109;
        cb_sidereal_day           = 0.99726968;
        cb_orbital_distance_miles = 584000000;
        cb_orbital_period_days    = earthYearInDays;  
    }
    if (cb === "5") {
        cb_diameter_miles         = 2159;
        cb_sidereal_day           = 27.321661;
        cb_orbital_distance_miles = 1499070; 
        cb_orbital_period_days    = 27.323;
    }
    if (cb === "6") {
        cb_diameter_miles         = 4217.246;
        cb_sidereal_day           = 1.02595675;
        cb_orbital_distance_miles = 888000000;
        cb_orbital_period_days    = 686.98;
    }
    if (cb === "7") {
        cb_diameter_miles         = 88731.8063;
        cb_sidereal_day           = 0.41007;
        cb_orbital_distance_miles = 3037000000;
        cb_orbital_period_days    = 4330.6;
    }
    if (cb === "8") {
        cb_diameter_miles         = 74974.6481;
        cb_sidereal_day           = 0.426;
        cb_orbital_distance_miles = 5565900000;
        cb_orbital_period_days    = 10755.7;
    }
    if (cb === "9") {
        cb_diameter_miles         = 31763.253;
        cb_sidereal_day           = 0.71833;
        cb_orbital_distance_miles = 11201300000;
        cb_orbital_period_days    = 30685;
    }
    if (cb === "10") {
        cb_diameter_miles         = 30775.272;
        cb_sidereal_day           = 0.67125;
        cb_orbital_distance_miles = 17562300000;
        cb_orbital_period_days    = 60190;
    }
    document.getElementById("txtDiameter").value = cb_diameter_miles;
    document.getElementById("txtRotation").value = cb_sidereal_day;
    document.getElementById("txtOrbitalDistance").value = cb_orbital_distance_miles;
    document.getElementById("txtOrbitalPeriod").value   = cb_orbital_period_days;
    calcSpeeds();
}
function presetCB ( cb ) { "use strict" ; var useJulianDays = 0 ; var earthYearInDays = 365 ; if ( useJulianDays === 1 ) { earthYearInDays = 365.256 ; } var cb_diameter_miles = 7926.2109 ; var cb_sidereal_day = 0.99726968 ; var cb_orbital_period_days = earthYearInDays ; var cb_orbital_distance_miles = 584000000 ; if ( cb === "1" ) { cb_diameter_miles = 864575.9 ; cb_sidereal_day = 25.379995 ; cb_orbital_distance_miles = ( 2 * 161057496139894200 ) * Math . PI ; cb_orbital_period_days = 242000000 * earthYearInDays ; } if ( cb === "2" ) { cb_diameter_miles = 3031.9186 ; cb_sidereal_day = 58.646225 ; cb_orbital_distance_miles = 223700000 ; cb_orbital_period_days = 87.97 ; } if ( cb === "3" ) { cb_diameter_miles = 7521.0769 ; cb_sidereal_day = 243.0187 ; cb_orbital_distance_miles = 422500000 ; cb_orbital_period_days = 224.7 ; } if ( cb === "4" ) { cb_diameter_miles = 7926.2109 ; cb_sidereal_day = 0.99726968 ; cb_orbital_distance_miles = 584000000 ; cb_orbital_period_days = earthYearInDays ; } if ( cb === "5" ) { cb_diameter_miles = 2159 ; cb_sidereal_day = 27.321661 ; cb_orbital_distance_miles = 1499070 ; cb_orbital_period_days = 27.323 ; } if ( cb === "6" ) { cb_diameter_miles = 4217.246 ; cb_sidereal_day = 1.02595675 ; cb_orbital_distance_miles = 888000000 ; cb_orbital_period_days = 686.98 ; } if ( cb === "7" ) { cb_diameter_miles = 88731.8063 ; cb_sidereal_day = 0.41007 ; cb_orbital_distance_miles = 3037000000 ; cb_orbital_period_days = 4330.6 ; } if ( cb === "8" ) { cb_diameter_miles = 74974.6481 ; cb_sidereal_day = 0.426 ; cb_orbital_distance_miles = 5565900000 ; cb_orbital_period_days = 10755.7 ; } if ( cb === "9" ) { cb_diameter_miles = 31763.253 ; cb_sidereal_day = 0.71833 ; cb_orbital_distance_miles = 11201300000 ; cb_orbital_period_days = 30685 ; } if ( cb === "10" ) { cb_diameter_miles = 30775.272 ; cb_sidereal_day = 0.67125 ; cb_orbital_distance_miles = 17562300000 ; cb_orbital_period_days = 60190 ; } document . getElementById ( "txtDiameter" ) . value = cb_diameter_miles ; document . getElementById ( "txtRotation" ) . value = cb_sidereal_day ; document . getElementById ( "txtOrbitalDistance" ) . value = cb_orbital_distance_miles ; document . getElementById ( "txtOrbitalPeriod" ) . value = cb_orbital_period_days ; calcSpeeds ( ) ; }
preset Combo Box
  Notes: cb must not be a number, cb === 1 does not work
  I use 365 and not 365.2, this is to keep the numbers whole,
  in reality this an average and not the actual speed,
  this calculation needs a Maximum, Minimum and Current,
  set useJulianDays to 1 to change this to Julian days.
preset Combo Box Notes : cb must not be a number cb === 1 does not work I use 365 and not 365 . 2 this is to keep the numbers whole in reality this an average and not the actual speed this calculation needs a Maximum Minimum and Current set useJulianDays to 1 to change this to Julian days .
// alert("cb=" + cb); // Revolution period 365 /* Sun 483,000 to 514,495 miles per hour or 669,600,000.000 */ // 864948.7  864575.9 864938 // 1011954093357316200 // 88330000000 /* Mercury orbits the sun 105,947 or 105,954.682 miles */ /* Venus orbits the sun 78,341 or 78,345.201 miles per hour */ /* Earth orbits the sun  */ // 365 or 365.256 /*
        584000000 / (365 * 24) = 66666.666666667
        584000000 / 8760 = 67,000 mph
        */ /* Moon orbits Earth at a speed of 2,288 or 2,286.032 miles per hour */ // 477168.801082 452954.96804 1423000  1499070 /* Mars orbits the sun 53,979 or 53,858.919 miles per hour */ /* Jupiter orbits the sun 29,236 miles per hour or 29,220.354 */ /* Saturn orbits the sun 21,637 miles per hour or 21,561.823 */ /* Uranus orbits the sun 15,290 miles per hour or 15,210.065 Equatorial rotation velocity 5791.18 mph */ /* Neptune orbits the sun 12,253 miles per hour or 12,157.543 */