diff --git a/hsim-a318ceo/src/base/lvfr-horizonsim-airbus-a318-ceo/html_ui/Pages/VCockpit/Instruments/Airliners/lvfr-horizonsim-airbus-a318-ceo/FCU/A320_Neo_FCU.js b/hsim-a318ceo/src/base/lvfr-horizonsim-airbus-a318-ceo/html_ui/Pages/VCockpit/Instruments/Airliners/lvfr-horizonsim-airbus-a318-ceo/FCU/A320_Neo_FCU.js index fe071917..e0b415e6 100644 --- a/hsim-a318ceo/src/base/lvfr-horizonsim-airbus-a318-ceo/html_ui/Pages/VCockpit/Instruments/Airliners/lvfr-horizonsim-airbus-a318-ceo/FCU/A320_Neo_FCU.js +++ b/hsim-a318ceo/src/base/lvfr-horizonsim-airbus-a318-ceo/html_ui/Pages/VCockpit/Instruments/Airliners/lvfr-horizonsim-airbus-a318-ceo/FCU/A320_Neo_FCU.js @@ -1384,20 +1384,20 @@ class A320_Neo_FCU_Pressure extends A320_Neo_FCU_Component { this.currentValue = _value; this.lightsTest = _lightsTest; if (this.lightsTest) { - this.setElementVisibility(this.standardElem, false); - this.setElementVisibility(this.selectedElem, true); + this.setElementVisibility(this.standardElem, false) + this.setElementVisibility(this.selectedElem, true) this.setTextElementActive(this.textQFE, true); this.setTextElementActive(this.textQNH, true); this.textValueContent = "88.88"; return; } if (this.currentMode == "STD") { - this.setElementVisibility(this.standardElem, true); - this.setElementVisibility(this.selectedElem, false); + this.setElementVisibility(this.standardElem, true) + this.setElementVisibility(this.selectedElem, false) SimVar.SetSimVarValue("KOHLSMAN SETTING STD", "Bool", 1); } else { - this.setElementVisibility(this.standardElem, false); - this.setElementVisibility(this.selectedElem, true); + this.setElementVisibility(this.standardElem, false) + this.setElementVisibility(this.selectedElem, true) SimVar.SetSimVarValue("KOHLSMAN SETTING STD", "Bool", 0); const isQFE = (this.currentMode == "QFE") ? true : false; this.setTextElementActive(this.textQFE, isQFE); @@ -1488,6 +1488,7 @@ class A320_Neo_FCU_SmallScreen extends NavSystemElement { // Earth-Sun distance, angular diameter of Sun // p. L2: Greenwich mean sidereal time (ignoring T^2, T^3 terms) + // Authors: Dr. Joe Michalsky (joe@asrc.albany.edu) // Dr. Lee Harrison (lee@asrc.albany.edu) // Atmospheric Sciences Research Center @@ -1499,6 +1500,7 @@ class A320_Neo_FCU_SmallScreen extends NavSystemElement { // Code 913 // Greenbelt, MD 20771 + // WARNING: Do not use this routine outside the year range // 1950-2050. The approximations become increasingly // worse, and the calculation of Julian date becomes @@ -1527,6 +1529,7 @@ class A320_Neo_FCU_SmallScreen extends NavSystemElement { // LONG longitude [degrees] // (REAL; range -180.0 to 180.0; east is positive) + // Output: // AZ solar azimuth angle (measured east from north, @@ -1541,6 +1544,7 @@ class A320_Neo_FCU_SmallScreen extends NavSystemElement { // (1 AU = mean Earth-sun distance = 1.49597871E+11 m // in IAU 1976 System of Astronomical Constants) + // Local Variables: // DEC Declination (radians) @@ -1649,7 +1653,7 @@ function calculateSunAzimuthElevation(utcTime, lat, lon, out = undefined) { // current Julian date (actually add 2,400,000 for true JD); LEAP = leap days since 1949; // 32916.5 is midnite 0 jan 1949 minus 2.4e6 - const delta = year - 1949; + const delta = year - 1949; const leap = delta / 4; let jd = 32916.5 + (delta * 365 + leap + day) + hour / 24; @@ -1663,7 +1667,7 @@ function calculateSunAzimuthElevation(utcTime, lat, lon, out = undefined) { // ecliptic coordinates // 51545.0 + 2.4e6 = noon 1 jan 2000 - const time = jd - 51545.0; + const time = jd - 51545.0; // force mean longitude between 0 and 360 degs let meanLon = (280.460 + 0.9856474 * time) % 360; @@ -1687,7 +1691,7 @@ function calculateSunAzimuthElevation(utcTime, lat, lon, out = undefined) { } ecLong = ecLong * rpd; - const obiquityEc = (23.439 - 0.0000004 * time) * rpd; + let obiquityEc = (23.439 - 0.0000004 * time) * rpd; // right ascension const NUM = Math.cos(obiquityEc) * Math.sin(ecLong); @@ -1696,9 +1700,9 @@ function calculateSunAzimuthElevation(utcTime, lat, lon, out = undefined) { // Force right ascension between 0 and 2*pi if (DEN < 0.0) { - RA = RA + Math.PI; + RA = RA + Math.PI; } else if (NUM < 0) { - RA = RA + Math.PI * 2; + RA = RA + Math.PI * 2; } // declination @@ -1714,7 +1718,7 @@ function calculateSunAzimuthElevation(utcTime, lat, lon, out = undefined) { } // local mean sidereal time in radians - let LMST = (GMST + lon / 15) % 24; + let LMST = (GMST + lon / 15) % 24; if (LMST < 0) { LMST += 24; } @@ -1748,8 +1752,8 @@ function calculateSunAzimuthElevation(utcTime, lat, lon, out = undefined) { } // Convert elevation and azimuth to degrees - solarElevation /= rpd; - solarAzimuth /= rpd; + solarElevation /= rpd + solarAzimuth /= rpd // ======== Refraction correction for U.S. Standard Atmos. ========== // (assumes elevation in degs) (3.51823=1013.25 mb/288 K) @@ -1761,7 +1765,7 @@ function calculateSunAzimuthElevation(utcTime, lat, lon, out = undefined) { (1. + solarElevation * (0.505 + 0.0845 * solarElevation)); } - solarElevation = solarElevation + REFRAC; + solarElevation = solarElevation + REFRAC // =================================================================== // distance to sun in A.U. & diameter in degs const solarDistance = 1.00014 - 0.01671 * Math.cos(meanAnomaly) - 0.00014 * Math.cos(2 * meanAnomaly); @@ -1842,7 +1846,7 @@ class Subject { if (initialNotify) { newSub.handler(this.value); } - }; + } newSub.unsub = () => this.subs.splice(this.subs.indexOf(newSub), 1); this.subs.push(newSub); diff --git a/hsim-a319ceo/src/base/lvfr-horizonsim-airbus-a319-ceo/html_ui/Pages/VCockpit/Instruments/Airliners/lvfr-horizonsim-airbus-a319-ceo/FCU/A320_Neo_FCU.js b/hsim-a319ceo/src/base/lvfr-horizonsim-airbus-a319-ceo/html_ui/Pages/VCockpit/Instruments/Airliners/lvfr-horizonsim-airbus-a319-ceo/FCU/A320_Neo_FCU.js index fe071917..e0b415e6 100644 --- a/hsim-a319ceo/src/base/lvfr-horizonsim-airbus-a319-ceo/html_ui/Pages/VCockpit/Instruments/Airliners/lvfr-horizonsim-airbus-a319-ceo/FCU/A320_Neo_FCU.js +++ b/hsim-a319ceo/src/base/lvfr-horizonsim-airbus-a319-ceo/html_ui/Pages/VCockpit/Instruments/Airliners/lvfr-horizonsim-airbus-a319-ceo/FCU/A320_Neo_FCU.js @@ -1384,20 +1384,20 @@ class A320_Neo_FCU_Pressure extends A320_Neo_FCU_Component { this.currentValue = _value; this.lightsTest = _lightsTest; if (this.lightsTest) { - this.setElementVisibility(this.standardElem, false); - this.setElementVisibility(this.selectedElem, true); + this.setElementVisibility(this.standardElem, false) + this.setElementVisibility(this.selectedElem, true) this.setTextElementActive(this.textQFE, true); this.setTextElementActive(this.textQNH, true); this.textValueContent = "88.88"; return; } if (this.currentMode == "STD") { - this.setElementVisibility(this.standardElem, true); - this.setElementVisibility(this.selectedElem, false); + this.setElementVisibility(this.standardElem, true) + this.setElementVisibility(this.selectedElem, false) SimVar.SetSimVarValue("KOHLSMAN SETTING STD", "Bool", 1); } else { - this.setElementVisibility(this.standardElem, false); - this.setElementVisibility(this.selectedElem, true); + this.setElementVisibility(this.standardElem, false) + this.setElementVisibility(this.selectedElem, true) SimVar.SetSimVarValue("KOHLSMAN SETTING STD", "Bool", 0); const isQFE = (this.currentMode == "QFE") ? true : false; this.setTextElementActive(this.textQFE, isQFE); @@ -1488,6 +1488,7 @@ class A320_Neo_FCU_SmallScreen extends NavSystemElement { // Earth-Sun distance, angular diameter of Sun // p. L2: Greenwich mean sidereal time (ignoring T^2, T^3 terms) + // Authors: Dr. Joe Michalsky (joe@asrc.albany.edu) // Dr. Lee Harrison (lee@asrc.albany.edu) // Atmospheric Sciences Research Center @@ -1499,6 +1500,7 @@ class A320_Neo_FCU_SmallScreen extends NavSystemElement { // Code 913 // Greenbelt, MD 20771 + // WARNING: Do not use this routine outside the year range // 1950-2050. The approximations become increasingly // worse, and the calculation of Julian date becomes @@ -1527,6 +1529,7 @@ class A320_Neo_FCU_SmallScreen extends NavSystemElement { // LONG longitude [degrees] // (REAL; range -180.0 to 180.0; east is positive) + // Output: // AZ solar azimuth angle (measured east from north, @@ -1541,6 +1544,7 @@ class A320_Neo_FCU_SmallScreen extends NavSystemElement { // (1 AU = mean Earth-sun distance = 1.49597871E+11 m // in IAU 1976 System of Astronomical Constants) + // Local Variables: // DEC Declination (radians) @@ -1649,7 +1653,7 @@ function calculateSunAzimuthElevation(utcTime, lat, lon, out = undefined) { // current Julian date (actually add 2,400,000 for true JD); LEAP = leap days since 1949; // 32916.5 is midnite 0 jan 1949 minus 2.4e6 - const delta = year - 1949; + const delta = year - 1949; const leap = delta / 4; let jd = 32916.5 + (delta * 365 + leap + day) + hour / 24; @@ -1663,7 +1667,7 @@ function calculateSunAzimuthElevation(utcTime, lat, lon, out = undefined) { // ecliptic coordinates // 51545.0 + 2.4e6 = noon 1 jan 2000 - const time = jd - 51545.0; + const time = jd - 51545.0; // force mean longitude between 0 and 360 degs let meanLon = (280.460 + 0.9856474 * time) % 360; @@ -1687,7 +1691,7 @@ function calculateSunAzimuthElevation(utcTime, lat, lon, out = undefined) { } ecLong = ecLong * rpd; - const obiquityEc = (23.439 - 0.0000004 * time) * rpd; + let obiquityEc = (23.439 - 0.0000004 * time) * rpd; // right ascension const NUM = Math.cos(obiquityEc) * Math.sin(ecLong); @@ -1696,9 +1700,9 @@ function calculateSunAzimuthElevation(utcTime, lat, lon, out = undefined) { // Force right ascension between 0 and 2*pi if (DEN < 0.0) { - RA = RA + Math.PI; + RA = RA + Math.PI; } else if (NUM < 0) { - RA = RA + Math.PI * 2; + RA = RA + Math.PI * 2; } // declination @@ -1714,7 +1718,7 @@ function calculateSunAzimuthElevation(utcTime, lat, lon, out = undefined) { } // local mean sidereal time in radians - let LMST = (GMST + lon / 15) % 24; + let LMST = (GMST + lon / 15) % 24; if (LMST < 0) { LMST += 24; } @@ -1748,8 +1752,8 @@ function calculateSunAzimuthElevation(utcTime, lat, lon, out = undefined) { } // Convert elevation and azimuth to degrees - solarElevation /= rpd; - solarAzimuth /= rpd; + solarElevation /= rpd + solarAzimuth /= rpd // ======== Refraction correction for U.S. Standard Atmos. ========== // (assumes elevation in degs) (3.51823=1013.25 mb/288 K) @@ -1761,7 +1765,7 @@ function calculateSunAzimuthElevation(utcTime, lat, lon, out = undefined) { (1. + solarElevation * (0.505 + 0.0845 * solarElevation)); } - solarElevation = solarElevation + REFRAC; + solarElevation = solarElevation + REFRAC // =================================================================== // distance to sun in A.U. & diameter in degs const solarDistance = 1.00014 - 0.01671 * Math.cos(meanAnomaly) - 0.00014 * Math.cos(2 * meanAnomaly); @@ -1842,7 +1846,7 @@ class Subject { if (initialNotify) { newSub.handler(this.value); } - }; + } newSub.unsub = () => this.subs.splice(this.subs.indexOf(newSub), 1); this.subs.push(newSub); diff --git a/hsim-a320ceo/src/base/lvfr-horizonsim-airbus-a320-ceo/html_ui/Pages/VCockpit/Instruments/Airliners/lvfr-horizonsim-airbus-a320-ceo/FCU/A320_Neo_FCU.js b/hsim-a320ceo/src/base/lvfr-horizonsim-airbus-a320-ceo/html_ui/Pages/VCockpit/Instruments/Airliners/lvfr-horizonsim-airbus-a320-ceo/FCU/A320_Neo_FCU.js index fe071917..e0b415e6 100644 --- a/hsim-a320ceo/src/base/lvfr-horizonsim-airbus-a320-ceo/html_ui/Pages/VCockpit/Instruments/Airliners/lvfr-horizonsim-airbus-a320-ceo/FCU/A320_Neo_FCU.js +++ b/hsim-a320ceo/src/base/lvfr-horizonsim-airbus-a320-ceo/html_ui/Pages/VCockpit/Instruments/Airliners/lvfr-horizonsim-airbus-a320-ceo/FCU/A320_Neo_FCU.js @@ -1384,20 +1384,20 @@ class A320_Neo_FCU_Pressure extends A320_Neo_FCU_Component { this.currentValue = _value; this.lightsTest = _lightsTest; if (this.lightsTest) { - this.setElementVisibility(this.standardElem, false); - this.setElementVisibility(this.selectedElem, true); + this.setElementVisibility(this.standardElem, false) + this.setElementVisibility(this.selectedElem, true) this.setTextElementActive(this.textQFE, true); this.setTextElementActive(this.textQNH, true); this.textValueContent = "88.88"; return; } if (this.currentMode == "STD") { - this.setElementVisibility(this.standardElem, true); - this.setElementVisibility(this.selectedElem, false); + this.setElementVisibility(this.standardElem, true) + this.setElementVisibility(this.selectedElem, false) SimVar.SetSimVarValue("KOHLSMAN SETTING STD", "Bool", 1); } else { - this.setElementVisibility(this.standardElem, false); - this.setElementVisibility(this.selectedElem, true); + this.setElementVisibility(this.standardElem, false) + this.setElementVisibility(this.selectedElem, true) SimVar.SetSimVarValue("KOHLSMAN SETTING STD", "Bool", 0); const isQFE = (this.currentMode == "QFE") ? true : false; this.setTextElementActive(this.textQFE, isQFE); @@ -1488,6 +1488,7 @@ class A320_Neo_FCU_SmallScreen extends NavSystemElement { // Earth-Sun distance, angular diameter of Sun // p. L2: Greenwich mean sidereal time (ignoring T^2, T^3 terms) + // Authors: Dr. Joe Michalsky (joe@asrc.albany.edu) // Dr. Lee Harrison (lee@asrc.albany.edu) // Atmospheric Sciences Research Center @@ -1499,6 +1500,7 @@ class A320_Neo_FCU_SmallScreen extends NavSystemElement { // Code 913 // Greenbelt, MD 20771 + // WARNING: Do not use this routine outside the year range // 1950-2050. The approximations become increasingly // worse, and the calculation of Julian date becomes @@ -1527,6 +1529,7 @@ class A320_Neo_FCU_SmallScreen extends NavSystemElement { // LONG longitude [degrees] // (REAL; range -180.0 to 180.0; east is positive) + // Output: // AZ solar azimuth angle (measured east from north, @@ -1541,6 +1544,7 @@ class A320_Neo_FCU_SmallScreen extends NavSystemElement { // (1 AU = mean Earth-sun distance = 1.49597871E+11 m // in IAU 1976 System of Astronomical Constants) + // Local Variables: // DEC Declination (radians) @@ -1649,7 +1653,7 @@ function calculateSunAzimuthElevation(utcTime, lat, lon, out = undefined) { // current Julian date (actually add 2,400,000 for true JD); LEAP = leap days since 1949; // 32916.5 is midnite 0 jan 1949 minus 2.4e6 - const delta = year - 1949; + const delta = year - 1949; const leap = delta / 4; let jd = 32916.5 + (delta * 365 + leap + day) + hour / 24; @@ -1663,7 +1667,7 @@ function calculateSunAzimuthElevation(utcTime, lat, lon, out = undefined) { // ecliptic coordinates // 51545.0 + 2.4e6 = noon 1 jan 2000 - const time = jd - 51545.0; + const time = jd - 51545.0; // force mean longitude between 0 and 360 degs let meanLon = (280.460 + 0.9856474 * time) % 360; @@ -1687,7 +1691,7 @@ function calculateSunAzimuthElevation(utcTime, lat, lon, out = undefined) { } ecLong = ecLong * rpd; - const obiquityEc = (23.439 - 0.0000004 * time) * rpd; + let obiquityEc = (23.439 - 0.0000004 * time) * rpd; // right ascension const NUM = Math.cos(obiquityEc) * Math.sin(ecLong); @@ -1696,9 +1700,9 @@ function calculateSunAzimuthElevation(utcTime, lat, lon, out = undefined) { // Force right ascension between 0 and 2*pi if (DEN < 0.0) { - RA = RA + Math.PI; + RA = RA + Math.PI; } else if (NUM < 0) { - RA = RA + Math.PI * 2; + RA = RA + Math.PI * 2; } // declination @@ -1714,7 +1718,7 @@ function calculateSunAzimuthElevation(utcTime, lat, lon, out = undefined) { } // local mean sidereal time in radians - let LMST = (GMST + lon / 15) % 24; + let LMST = (GMST + lon / 15) % 24; if (LMST < 0) { LMST += 24; } @@ -1748,8 +1752,8 @@ function calculateSunAzimuthElevation(utcTime, lat, lon, out = undefined) { } // Convert elevation and azimuth to degrees - solarElevation /= rpd; - solarAzimuth /= rpd; + solarElevation /= rpd + solarAzimuth /= rpd // ======== Refraction correction for U.S. Standard Atmos. ========== // (assumes elevation in degs) (3.51823=1013.25 mb/288 K) @@ -1761,7 +1765,7 @@ function calculateSunAzimuthElevation(utcTime, lat, lon, out = undefined) { (1. + solarElevation * (0.505 + 0.0845 * solarElevation)); } - solarElevation = solarElevation + REFRAC; + solarElevation = solarElevation + REFRAC // =================================================================== // distance to sun in A.U. & diameter in degs const solarDistance = 1.00014 - 0.01671 * Math.cos(meanAnomaly) - 0.00014 * Math.cos(2 * meanAnomaly); @@ -1842,7 +1846,7 @@ class Subject { if (initialNotify) { newSub.handler(this.value); } - }; + } newSub.unsub = () => this.subs.splice(this.subs.indexOf(newSub), 1); this.subs.push(newSub); diff --git a/hsim-a321neo/src/base/lvfr-horizonsim-airbus-a321-neo/html_ui/Pages/VCockpit/Instruments/Airliners/lvfr-horizonsim-airbus-a321-neo/FCU/A320_Neo_FCU.js b/hsim-a321neo/src/base/lvfr-horizonsim-airbus-a321-neo/html_ui/Pages/VCockpit/Instruments/Airliners/lvfr-horizonsim-airbus-a321-neo/FCU/A320_Neo_FCU.js index fe071917..e0b415e6 100644 --- a/hsim-a321neo/src/base/lvfr-horizonsim-airbus-a321-neo/html_ui/Pages/VCockpit/Instruments/Airliners/lvfr-horizonsim-airbus-a321-neo/FCU/A320_Neo_FCU.js +++ b/hsim-a321neo/src/base/lvfr-horizonsim-airbus-a321-neo/html_ui/Pages/VCockpit/Instruments/Airliners/lvfr-horizonsim-airbus-a321-neo/FCU/A320_Neo_FCU.js @@ -1384,20 +1384,20 @@ class A320_Neo_FCU_Pressure extends A320_Neo_FCU_Component { this.currentValue = _value; this.lightsTest = _lightsTest; if (this.lightsTest) { - this.setElementVisibility(this.standardElem, false); - this.setElementVisibility(this.selectedElem, true); + this.setElementVisibility(this.standardElem, false) + this.setElementVisibility(this.selectedElem, true) this.setTextElementActive(this.textQFE, true); this.setTextElementActive(this.textQNH, true); this.textValueContent = "88.88"; return; } if (this.currentMode == "STD") { - this.setElementVisibility(this.standardElem, true); - this.setElementVisibility(this.selectedElem, false); + this.setElementVisibility(this.standardElem, true) + this.setElementVisibility(this.selectedElem, false) SimVar.SetSimVarValue("KOHLSMAN SETTING STD", "Bool", 1); } else { - this.setElementVisibility(this.standardElem, false); - this.setElementVisibility(this.selectedElem, true); + this.setElementVisibility(this.standardElem, false) + this.setElementVisibility(this.selectedElem, true) SimVar.SetSimVarValue("KOHLSMAN SETTING STD", "Bool", 0); const isQFE = (this.currentMode == "QFE") ? true : false; this.setTextElementActive(this.textQFE, isQFE); @@ -1488,6 +1488,7 @@ class A320_Neo_FCU_SmallScreen extends NavSystemElement { // Earth-Sun distance, angular diameter of Sun // p. L2: Greenwich mean sidereal time (ignoring T^2, T^3 terms) + // Authors: Dr. Joe Michalsky (joe@asrc.albany.edu) // Dr. Lee Harrison (lee@asrc.albany.edu) // Atmospheric Sciences Research Center @@ -1499,6 +1500,7 @@ class A320_Neo_FCU_SmallScreen extends NavSystemElement { // Code 913 // Greenbelt, MD 20771 + // WARNING: Do not use this routine outside the year range // 1950-2050. The approximations become increasingly // worse, and the calculation of Julian date becomes @@ -1527,6 +1529,7 @@ class A320_Neo_FCU_SmallScreen extends NavSystemElement { // LONG longitude [degrees] // (REAL; range -180.0 to 180.0; east is positive) + // Output: // AZ solar azimuth angle (measured east from north, @@ -1541,6 +1544,7 @@ class A320_Neo_FCU_SmallScreen extends NavSystemElement { // (1 AU = mean Earth-sun distance = 1.49597871E+11 m // in IAU 1976 System of Astronomical Constants) + // Local Variables: // DEC Declination (radians) @@ -1649,7 +1653,7 @@ function calculateSunAzimuthElevation(utcTime, lat, lon, out = undefined) { // current Julian date (actually add 2,400,000 for true JD); LEAP = leap days since 1949; // 32916.5 is midnite 0 jan 1949 minus 2.4e6 - const delta = year - 1949; + const delta = year - 1949; const leap = delta / 4; let jd = 32916.5 + (delta * 365 + leap + day) + hour / 24; @@ -1663,7 +1667,7 @@ function calculateSunAzimuthElevation(utcTime, lat, lon, out = undefined) { // ecliptic coordinates // 51545.0 + 2.4e6 = noon 1 jan 2000 - const time = jd - 51545.0; + const time = jd - 51545.0; // force mean longitude between 0 and 360 degs let meanLon = (280.460 + 0.9856474 * time) % 360; @@ -1687,7 +1691,7 @@ function calculateSunAzimuthElevation(utcTime, lat, lon, out = undefined) { } ecLong = ecLong * rpd; - const obiquityEc = (23.439 - 0.0000004 * time) * rpd; + let obiquityEc = (23.439 - 0.0000004 * time) * rpd; // right ascension const NUM = Math.cos(obiquityEc) * Math.sin(ecLong); @@ -1696,9 +1700,9 @@ function calculateSunAzimuthElevation(utcTime, lat, lon, out = undefined) { // Force right ascension between 0 and 2*pi if (DEN < 0.0) { - RA = RA + Math.PI; + RA = RA + Math.PI; } else if (NUM < 0) { - RA = RA + Math.PI * 2; + RA = RA + Math.PI * 2; } // declination @@ -1714,7 +1718,7 @@ function calculateSunAzimuthElevation(utcTime, lat, lon, out = undefined) { } // local mean sidereal time in radians - let LMST = (GMST + lon / 15) % 24; + let LMST = (GMST + lon / 15) % 24; if (LMST < 0) { LMST += 24; } @@ -1748,8 +1752,8 @@ function calculateSunAzimuthElevation(utcTime, lat, lon, out = undefined) { } // Convert elevation and azimuth to degrees - solarElevation /= rpd; - solarAzimuth /= rpd; + solarElevation /= rpd + solarAzimuth /= rpd // ======== Refraction correction for U.S. Standard Atmos. ========== // (assumes elevation in degs) (3.51823=1013.25 mb/288 K) @@ -1761,7 +1765,7 @@ function calculateSunAzimuthElevation(utcTime, lat, lon, out = undefined) { (1. + solarElevation * (0.505 + 0.0845 * solarElevation)); } - solarElevation = solarElevation + REFRAC; + solarElevation = solarElevation + REFRAC // =================================================================== // distance to sun in A.U. & diameter in degs const solarDistance = 1.00014 - 0.01671 * Math.cos(meanAnomaly) - 0.00014 * Math.cos(2 * meanAnomaly); @@ -1842,7 +1846,7 @@ class Subject { if (initialNotify) { newSub.handler(this.value); } - }; + } newSub.unsub = () => this.subs.splice(this.subs.indexOf(newSub), 1); this.subs.push(newSub);