Calculate Greenwich Mean Sidereal Time - Node.js Date

Node.js examples for Date:Time

Description

Calculate Greenwich Mean Sidereal Time

Demo Code


Date.prototype.getGMST = function() {
    /* Calculate Greenwich Mean Sidereal Time according to 
       http://aa.usno.navy.mil/faq/docs/GAST.php */
    var julianDay = this.getJulian();
    var d = julianDay - 2451545.0;
    // Low precision equation is good enough for our purposes.
    return (18.697374558 + 24.06570982441908 * d) % 24;
}

Related Tutorials