diff --git a/CHANGELOG.md b/CHANGELOG.md index 513e84a..8fdedd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.7.1 + +* Fix ecliptic positioning of sun, moon, and planets in southern hemisphere sky. + ## 1.7.0 * New option to step one sidereal day at a time (instead of 24 hours at a time) during high-speed animation. diff --git a/messages.xlf b/messages.xlf index 54a0cf7..39d0eea 100644 --- a/messages.xlf +++ b/messages.xlf @@ -384,109 +384,109 @@ Turn off "Track current time" so you can edit the time? src/app/app.component.ts - 1025 + 1031 Turn off "Track current time" and change the clock time? src/app/app.component.ts - 1134 + 1140 Event src/app/app.component.ts - 1177 + 1183 src/app/app.component.ts - 1181 + 1187 Event outside of - year range. src/app/app.component.ts - 1178 + 1184 Sunrise src/app/app.component.ts - 1188 + 1194 Sunset src/app/app.component.ts - 1190 + 1196 Transit src/app/app.component.ts - 1192 + 1198 Vernal equinox src/app/app.component.ts - 1194 + 1200 Summer solstice src/app/app.component.ts - 1196 + 1202 Autumnal equinox src/app/app.component.ts - 1198 + 1204 Winter Solstice src/app/app.component.ts - 1200 + 1206 New moon src/app/app.component.ts - 1202 + 1208 First quarter src/app/app.component.ts - 1204 + 1210 Full moon src/app/app.component.ts - 1206 + 1212 Third quarter src/app/app.component.ts - 1208 + 1214 diff --git a/package-lock.json b/package-lock.json index 929697b..db5246b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "prague-clock", - "version": "1.7.0", + "version": "1.7.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "prague-clock", - "version": "1.7.0", + "version": "1.7.1", "dependencies": { "@angular/animations": "~13.2.0", "@angular/cdk": "^13.2.6", @@ -22,11 +22,11 @@ "@fortawesome/free-brands-svg-icons": "^6.0.0", "@fortawesome/free-regular-svg-icons": "^6.0.0", "@fortawesome/free-solid-svg-icons": "^6.1.1", - "@tubular/astronomy": "^3.1.0", + "@tubular/astronomy": "^3.3.0", "@tubular/math": "^3.1.0", "@tubular/ng-widgets": "^2.1.2", - "@tubular/time": "^3.8.1", - "@tubular/util": "^4.9.1", + "@tubular/time": "^3.8.2", + "@tubular/util": "^4.11.0", "primeicons": "^5.0.0", "primeng": "^13.3.3", "rxjs": "~7.5.0", @@ -43,7 +43,7 @@ "@angular/cli": "~13.2.5", "@angular/compiler-cli": "~13.2.0", "@angular/localize": "^13.2.7", - "@tubular/browser-check": "^1.2.0", + "@tubular/browser-check": "^1.3.0", "@types/jasmine": "~3.10.6", "@types/node": "^12.20.50", "@types/three": "^0.139.0", @@ -3014,23 +3014,23 @@ } }, "node_modules/@tubular/astronomy": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@tubular/astronomy/-/astronomy-3.1.0.tgz", - "integrity": "sha512-NIMoDH/ssZo4JjRwvx/Ql1uOd8yw7A8LFZ6nGYc50XnE+6hxOsXzFllC3Y+afcr77/rtJFcoTU3nufjQ2SOFcw==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@tubular/astronomy/-/astronomy-3.3.0.tgz", + "integrity": "sha512-CSioY7aT9NF/00cmpo34kLeP6aQVD5oEqdnw4ViRAYUtxUCi3ZaXJ9yGKCKNHveHsB6iBgj/XC4TuvbQNfudCg==", "dependencies": { "@tubular/array-buffer-reader": "^3.0.2", "@tubular/math": "^3.1.0", - "@tubular/time": "^3.8.0", - "@tubular/util": "^4.5.1" + "@tubular/time": "^3.8.2", + "@tubular/util": "^4.10.0" }, "engines": { "node": ">=10.24.1" } }, "node_modules/@tubular/browser-check": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@tubular/browser-check/-/browser-check-1.2.0.tgz", - "integrity": "sha512-rLtDajb56gYJvrZheENgM8u9bejncJ0ITXUJTWedNiosL/q36j0f/NgEM2da5mUmIqXIfrLCIW2Kbkg+Nmf9gQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@tubular/browser-check/-/browser-check-1.3.0.tgz", + "integrity": "sha512-Czi+fMP0YNnMm+PIOD5KGlBOahO8ym4PKAodumkor28BrdJhrW/SE9HRVGodpLULJO3AyPQwpoKKFTrJLxzg5w==", "dev": true }, "node_modules/@tubular/math": { @@ -3059,25 +3059,25 @@ } }, "node_modules/@tubular/time": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@tubular/time/-/time-3.8.1.tgz", - "integrity": "sha512-/3BVk58gG77FG7IklBvsUF8/sTg3JTsZHbYGYAgi9Y/qpZnGvRwJOOmS0TLRzfGr4D8XMr282PHXnec77rniYQ==", + "version": "3.8.2", + "resolved": "https://registry.npmjs.org/@tubular/time/-/time-3.8.2.tgz", + "integrity": "sha512-ZGUFmW9o6iOOGi29EcmBMp+d36Pnbx9q3/Uozn7eAdBB0nZsSmA2jl0kqxUAeaaI4jxIj2AT0EDlOX2wORDyAw==", "dependencies": { "@tubular/math": "^3.1.0", - "@tubular/util": "^4.4.0" + "@tubular/util": "^4.9.2" }, "engines": { "node": ">=10.24.1" }, "optionalDependencies": { - "by-request": "^1.2.7", + "by-request": "^1.3.3", "json-z": "^3.3.2" } }, "node_modules/@tubular/util": { - "version": "4.9.1", - "resolved": "https://registry.npmjs.org/@tubular/util/-/util-4.9.1.tgz", - "integrity": "sha512-oykvYHnCuIx+NWMouAKPt89AkcL9+tNhiyf2WqDyFn96tf27Gddkp4oWnjscwz9IhulW1Aa8IFGDs3ZJ8o6zmw==", + "version": "4.11.0", + "resolved": "https://registry.npmjs.org/@tubular/util/-/util-4.11.0.tgz", + "integrity": "sha512-B2DovjcVMppWhm+VwJ9tP5qFIMvB41uibhwVylaDEmdlNIdXy31cKHZ68Eoz1w0uVLqKy3/nRecu08CfL5knog==", "engines": { "node": ">=10.24.1" } @@ -16766,20 +16766,20 @@ "integrity": "sha512-1cQnojuLyFY7K8L2Jc3OGfgipyYktqAKL01a/1p01v6R/KnHuSfnwWmRfswQg5zUNqav6yuouUhVOimT06EDPg==" }, "@tubular/astronomy": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@tubular/astronomy/-/astronomy-3.1.0.tgz", - "integrity": "sha512-NIMoDH/ssZo4JjRwvx/Ql1uOd8yw7A8LFZ6nGYc50XnE+6hxOsXzFllC3Y+afcr77/rtJFcoTU3nufjQ2SOFcw==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/@tubular/astronomy/-/astronomy-3.3.0.tgz", + "integrity": "sha512-CSioY7aT9NF/00cmpo34kLeP6aQVD5oEqdnw4ViRAYUtxUCi3ZaXJ9yGKCKNHveHsB6iBgj/XC4TuvbQNfudCg==", "requires": { "@tubular/array-buffer-reader": "^3.0.2", "@tubular/math": "^3.1.0", - "@tubular/time": "^3.8.0", - "@tubular/util": "^4.5.1" + "@tubular/time": "^3.8.2", + "@tubular/util": "^4.10.0" } }, "@tubular/browser-check": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@tubular/browser-check/-/browser-check-1.2.0.tgz", - "integrity": "sha512-rLtDajb56gYJvrZheENgM8u9bejncJ0ITXUJTWedNiosL/q36j0f/NgEM2da5mUmIqXIfrLCIW2Kbkg+Nmf9gQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@tubular/browser-check/-/browser-check-1.3.0.tgz", + "integrity": "sha512-Czi+fMP0YNnMm+PIOD5KGlBOahO8ym4PKAodumkor28BrdJhrW/SE9HRVGodpLULJO3AyPQwpoKKFTrJLxzg5w==", "dev": true }, "@tubular/math": { @@ -16796,20 +16796,20 @@ } }, "@tubular/time": { - "version": "3.8.1", - "resolved": "https://registry.npmjs.org/@tubular/time/-/time-3.8.1.tgz", - "integrity": "sha512-/3BVk58gG77FG7IklBvsUF8/sTg3JTsZHbYGYAgi9Y/qpZnGvRwJOOmS0TLRzfGr4D8XMr282PHXnec77rniYQ==", + "version": "3.8.2", + "resolved": "https://registry.npmjs.org/@tubular/time/-/time-3.8.2.tgz", + "integrity": "sha512-ZGUFmW9o6iOOGi29EcmBMp+d36Pnbx9q3/Uozn7eAdBB0nZsSmA2jl0kqxUAeaaI4jxIj2AT0EDlOX2wORDyAw==", "requires": { "@tubular/math": "^3.1.0", - "@tubular/util": "^4.4.0", - "by-request": "^1.2.7", + "@tubular/util": "^4.9.2", + "by-request": "^1.3.3", "json-z": "^3.3.2" } }, "@tubular/util": { - "version": "4.9.1", - "resolved": "https://registry.npmjs.org/@tubular/util/-/util-4.9.1.tgz", - "integrity": "sha512-oykvYHnCuIx+NWMouAKPt89AkcL9+tNhiyf2WqDyFn96tf27Gddkp4oWnjscwz9IhulW1Aa8IFGDs3ZJ8o6zmw==" + "version": "4.11.0", + "resolved": "https://registry.npmjs.org/@tubular/util/-/util-4.11.0.tgz", + "integrity": "sha512-B2DovjcVMppWhm+VwJ9tP5qFIMvB41uibhwVylaDEmdlNIdXy31cKHZ68Eoz1w0uVLqKy3/nRecu08CfL5knog==" }, "@types/body-parser": { "version": "1.19.2", diff --git a/package.json b/package.json index dee1dc8..4367c94 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prague-clock", - "version": "1.7.0", + "version": "1.7.1", "scripts": { "ng": "ng", "start": "ng serve --configuration=development", @@ -31,11 +31,11 @@ "@fortawesome/free-brands-svg-icons": "^6.0.0", "@fortawesome/free-regular-svg-icons": "^6.0.0", "@fortawesome/free-solid-svg-icons": "^6.1.1", - "@tubular/astronomy": "^3.1.0", + "@tubular/astronomy": "^3.3.0", "@tubular/math": "^3.1.0", "@tubular/ng-widgets": "^2.1.2", - "@tubular/time": "^3.8.1", - "@tubular/util": "^4.9.1", + "@tubular/time": "^3.8.2", + "@tubular/util": "^4.11.0", "primeicons": "^5.0.0", "primeng": "^13.3.3", "rxjs": "~7.5.0", @@ -52,7 +52,7 @@ "@angular/cli": "~13.2.5", "@angular/compiler-cli": "~13.2.0", "@angular/localize": "^13.2.7", - "@tubular/browser-check": "^1.2.0", + "@tubular/browser-check": "^1.3.0", "@types/jasmine": "~3.10.6", "@types/node": "^12.20.50", "@types/three": "^0.139.0", @@ -75,4 +75,4 @@ "stylelint-scss": "^4.2.0", "typescript": "~4.5.5" } -} \ No newline at end of file +} diff --git a/src/app/app.component.html b/src/app/app.component.html index 99741fa..0be8853 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -340,22 +340,22 @@ - + - + - + - + @@ -409,41 +409,41 @@ - - ♈︎ - - - ♉︎ + + ♓︎ - - ♊︎ + + ♒︎ - - ♋︎ + + ♑︎ - - ♌︎ + + ♐︎ - - ♍︎ + + ♏︎ - + ♎︎ - - ♏︎ + + ♍︎ - - ♐︎ + + ♌︎ - - ♑︎ + + ♋︎ - - ♒︎ + + ♊︎ - - ♓︎ + + ♉︎ + + + ♈︎ @@ -461,7 +461,7 @@ - + @@ -471,14 +471,14 @@ - + - + @@ -487,7 +487,7 @@ - + @@ -497,7 +497,7 @@ - + @@ -522,7 +522,7 @@ - + diff --git a/src/app/app.component.ts b/src/app/app.component.ts index e7aa8c4..3d3a8ec 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -566,7 +566,7 @@ export class AppComponent implements OnInit, SettingsHolder, SvgHost { } this.timingReference = calculateBasicPositions(refTime.utcMillis, this.getZone(), this.observer, - this.rotateSign, this.disableDst, this.timing); + this.disableDst, this.timing); this.lastWallTime = this.timingReference._date?.wallTime; this.timingReference._referenceTime = refTime.utcMillis; this.timingReference._endTime = endTime.utcMillis; @@ -901,20 +901,21 @@ export class AppComponent implements OnInit, SettingsHolder, SvgHost { const dayLength = this.sunsetB.ut - this.sunsetA.ut; const bohemianHour = (jdu - this.sunsetA.ut) / dayLength * 24; const basicPositions = - calculateBasicPositions(this.time, this.getZone(), this.observer, this.rotateSign, this.disableDst, this.timing); + calculateBasicPositions(this.time, this.getZone(), this.observer, this.disableDst, this.timing); const date = basicPositions._date; const wt = date.wallTime; const dateLocal = new DateTime(this.time, this.localTimezone); const jde = basicPositions._jde; + const southern = this.self.southern; this.lastWallTime = basicPositions._date?.wallTime; forEach(basicPositions as any, (key, value) => basicPosKey(key) && ((this as any)['true_' + key] = value)); - this.mercuryAngle = adjustForEclipticWheel(solarSystem.getEclipticPosition(MERCURY, jde).longitude.degrees); - this.venusAngle = adjustForEclipticWheel(solarSystem.getEclipticPosition(VENUS, jde).longitude.degrees); - this.marsAngle = adjustForEclipticWheel(solarSystem.getEclipticPosition(MARS, jde).longitude.degrees); - this.jupiterAngle = adjustForEclipticWheel(solarSystem.getEclipticPosition(JUPITER, jde).longitude.degrees); - this.saturnAngle = adjustForEclipticWheel(solarSystem.getEclipticPosition(SATURN, jde).longitude.degrees); + this.mercuryAngle = adjustForEclipticWheel(solarSystem.getEclipticPosition(MERCURY, jde).longitude.degrees, southern); + this.venusAngle = adjustForEclipticWheel(solarSystem.getEclipticPosition(VENUS, jde).longitude.degrees, southern); + this.marsAngle = adjustForEclipticWheel(solarSystem.getEclipticPosition(MARS, jde).longitude.degrees, southern); + this.jupiterAngle = adjustForEclipticWheel(solarSystem.getEclipticPosition(JUPITER, jde).longitude.degrees, southern); + this.saturnAngle = adjustForEclipticWheel(solarSystem.getEclipticPosition(SATURN, jde).longitude.degrees, southern); if (this.timing !== Timing.MODERN && this.timing !== Timing.CONSTRAINED_SUN) { if (!this.timingReference || this.time < this.timingReference._referenceTime || @@ -1005,12 +1006,17 @@ export class AppComponent implements OnInit, SettingsHolder, SvgHost { } } + eclipticTransform(): string { + return this.rotate(this.siderealAngle) + (this.self.southern ? ' scale(1, -1)' : ''); + } + rotate(angle: number): string { return `rotate(${angle * this.rotateSign})`; } reorient(angle: AngleTriplet): string { - return isSafari() ? null : `rotate(${(90 - angle.orig - angle.oe) * this.rotateSign})`; + return isSafari() ? null : this.self.southern ? + `scale(-1, 1) rotate(${90 + angle.orig - angle.oe})` : `rotate(${90 - angle.orig - angle.oe})`; } sunlitMoonPath(): string { diff --git a/src/locales/messages.cs.xlf b/src/locales/messages.cs.xlf index 8ca3cd2..30e8659 100644 --- a/src/locales/messages.cs.xlf +++ b/src/locales/messages.cs.xlf @@ -438,7 +438,7 @@ Vypnout "Sledujte aktuální čas", abyste mohli upravovat čas? src/app/app.component.ts - 1025 + 1031 @@ -446,7 +446,7 @@ Vypnout "Sledujte aktuální čas" a změnit čas? src/app/app.component.ts - 1134 + 1140 @@ -454,11 +454,11 @@ Událos src/app/app.component.ts - 1177 + 1183 src/app/app.component.ts - 1181 + 1187 @@ -466,7 +466,7 @@ Událost mimo rozsah let -. src/app/app.component.ts - 1178 + 1184 @@ -474,7 +474,7 @@ Východ slunce src/app/app.component.ts - 1188 + 1194 @@ -482,7 +482,7 @@ Západ slunce src/app/app.component.ts - 1190 + 1196 @@ -490,7 +490,7 @@ Kulminace src/app/app.component.ts - 1192 + 1198 @@ -498,7 +498,7 @@ Jarní rovnodennost src/app/app.component.ts - 1194 + 1200 @@ -506,7 +506,7 @@ Letní slunovrat src/app/app.component.ts - 1196 + 1202 @@ -514,7 +514,7 @@ Podzimní rovnodennost src/app/app.component.ts - 1198 + 1204 @@ -522,7 +522,7 @@ Zimní slunovrat src/app/app.component.ts - 1200 + 1206 @@ -530,7 +530,7 @@ Nový měsíc src/app/app.component.ts - 1202 + 1208 @@ -538,7 +538,7 @@ První čtvrt měsíc* src/app/app.component.ts - 1204 + 1210 @@ -546,7 +546,7 @@ Úplněk src/app/app.component.ts - 1206 + 1212 @@ -554,7 +554,7 @@ Třetí čtvrt měsíce src/app/app.component.ts - 1208 + 1214 diff --git a/src/locales/messages.de.xlf b/src/locales/messages.de.xlf index 84c3486..2ad1785 100644 --- a/src/locales/messages.de.xlf +++ b/src/locales/messages.de.xlf @@ -438,7 +438,7 @@ "Aktuelle Uhrzeit verfolgen" deaktivieren, damit Sie die Zeit bearbeiten können? src/app/app.component.ts - 1025 + 1031 @@ -446,7 +446,7 @@ "Aktuelle Uhrzeit verfolgen" deaktivieren und die Uhrzeit ändern? src/app/app.component.ts - 1134 + 1140 @@ -454,11 +454,11 @@ Vorfall src/app/app.component.ts - 1177 + 1183 src/app/app.component.ts - 1181 + 1187 @@ -466,7 +466,7 @@ Ereignis außerhalb des Zeitraums von bis Jahren. src/app/app.component.ts - 1178 + 1184 @@ -474,7 +474,7 @@ Sonnenaufgang src/app/app.component.ts - 1188 + 1194 @@ -482,7 +482,7 @@ Sonnenuntergang src/app/app.component.ts - 1190 + 1196 @@ -490,7 +490,7 @@ Transit src/app/app.component.ts - 1192 + 1198 @@ -498,7 +498,7 @@ Frühlings-Tagundnachtgleiche src/app/app.component.ts - 1194 + 1200 @@ -506,7 +506,7 @@ Sommersonnenwende src/app/app.component.ts - 1196 + 1202 @@ -514,7 +514,7 @@ Herbsttagundnachtgleiche src/app/app.component.ts - 1198 + 1204 @@ -522,7 +522,7 @@ Wintersonnenwende src/app/app.component.ts - 1200 + 1206 @@ -530,7 +530,7 @@ Neumond src/app/app.component.ts - 1202 + 1208 @@ -538,7 +538,7 @@ Mond im ersten Viertel src/app/app.component.ts - 1204 + 1210 @@ -546,7 +546,7 @@ Vollmond src/app/app.component.ts - 1206 + 1212 @@ -554,7 +554,7 @@ Mond im dritten Viertel src/app/app.component.ts - 1208 + 1214 diff --git a/src/locales/messages.es.xlf b/src/locales/messages.es.xlf index 6615f06..0a179fe 100644 --- a/src/locales/messages.es.xlf +++ b/src/locales/messages.es.xlf @@ -438,7 +438,7 @@ ¿Desactivar "Rastrear la hora actual" para poder editar la hora? src/app/app.component.ts - 1025 + 1031 @@ -446,7 +446,7 @@ ¿Desactivar "Rastrear la hora actual" y cambiar la hora del reloj? src/app/app.component.ts - 1134 + 1140 @@ -454,11 +454,11 @@ Evento src/app/app.component.ts - 1177 + 1183 src/app/app.component.ts - 1181 + 1187 @@ -466,7 +466,7 @@ Evento fuera del rango de años -. src/app/app.component.ts - 1178 + 1184 @@ -474,7 +474,7 @@ Amanecer src/app/app.component.ts - 1188 + 1194 @@ -482,7 +482,7 @@ Puesta de sol src/app/app.component.ts - 1190 + 1196 @@ -490,7 +490,7 @@ Tránsito src/app/app.component.ts - 1192 + 1198 @@ -498,7 +498,7 @@ Equinoccio de primavera src/app/app.component.ts - 1194 + 1200 @@ -506,7 +506,7 @@ Solsticio de verano src/app/app.component.ts - 1196 + 1202 @@ -514,7 +514,7 @@ Equinoccio de otoño src/app/app.component.ts - 1198 + 1204 @@ -522,7 +522,7 @@ Solsticio de invierno src/app/app.component.ts - 1200 + 1206 @@ -530,7 +530,7 @@ Luna nueva src/app/app.component.ts - 1202 + 1208 @@ -538,7 +538,7 @@ Primer cuarto src/app/app.component.ts - 1204 + 1210 @@ -546,7 +546,7 @@ Luna llena src/app/app.component.ts - 1206 + 1212 @@ -554,7 +554,7 @@ Tercer cuarto src/app/app.component.ts - 1208 + 1214 diff --git a/src/locales/messages.fr.xlf b/src/locales/messages.fr.xlf index 7ce4d2a..fcc01a5 100644 --- a/src/locales/messages.fr.xlf +++ b/src/locales/messages.fr.xlf @@ -438,7 +438,7 @@ Désactiver "Suivre l'heure actuelle" pour pouvoir modifier l'heure? src/app/app.component.ts - 1025 + 1031 @@ -446,7 +446,7 @@ Désactiver "Suivre l'heure actuelle" et modifier l'heure de l'horloge? src/app/app.component.ts - 1134 + 1140 @@ -454,11 +454,11 @@ Événement src/app/app.component.ts - 1177 + 1183 src/app/app.component.ts - 1181 + 1187 @@ -466,7 +466,7 @@ Événement en dehors de la plage des années -. src/app/app.component.ts - 1178 + 1184 @@ -474,7 +474,7 @@ Lever du soleil src/app/app.component.ts - 1188 + 1194 @@ -482,7 +482,7 @@ Coucher du soleil src/app/app.component.ts - 1190 + 1196 @@ -490,7 +490,7 @@ Transit src/app/app.component.ts - 1192 + 1198 @@ -498,7 +498,7 @@ Équinoxe vernal src/app/app.component.ts - 1194 + 1200 @@ -506,7 +506,7 @@ Solstice d'été src/app/app.component.ts - 1196 + 1202 @@ -514,7 +514,7 @@ Équinoxe d'automne src/app/app.component.ts - 1198 + 1204 @@ -522,7 +522,7 @@ Solstice d'hiver src/app/app.component.ts - 1200 + 1206 @@ -530,7 +530,7 @@ Nouvelle lune src/app/app.component.ts - 1202 + 1208 @@ -538,7 +538,7 @@ Premier quartier src/app/app.component.ts - 1204 + 1210 @@ -546,7 +546,7 @@ Pleine lune src/app/app.component.ts - 1206 + 1212 @@ -554,7 +554,7 @@ Troisième quart src/app/app.component.ts - 1208 + 1214 diff --git a/src/math/math.ts b/src/math/math.ts index b7f0b9c..099ca9f 100644 --- a/src/math/math.ts +++ b/src/math/math.ts @@ -114,11 +114,11 @@ export function eclipticToOffCenter(angle: number, inner = true): number { return mod((inner ? 26.207 : 23.4172) * cos_deg(angle) - angle, 360); } -export function adjustForEclipticWheel(angle: number): AngleTriplet { +export function adjustForEclipticWheel(angle: number, southern: boolean): AngleTriplet { return { orig: angle, - ie: 90 + eclipticToOffCenter(angle), - oe: 90 + eclipticToOffCenter(angle, false) + ie: 90 + eclipticToOffCenter(angle * (southern ? -1 : 1)), + oe: 90 + eclipticToOffCenter(angle * (southern ? -1 : 1), false) }; } @@ -133,20 +133,21 @@ export function calculateEclipticAnglesFromHandAngle(handAngle: number, sidereal } export function calculateBasicPositions(time: number, zone: string | Timezone, observer: SkyObserver, - rotateSign: number, disableDst: boolean, timing: Timing): BasicPositions { + disableDst: boolean, timing: Timing): BasicPositions { const _jdu = julianDay(time); const _jde = utToTdt(_jdu); const _date = new DateTime(time, zone); const wt = _date.wallTime; + const southern = observer.latitude.degrees < 0; const _hourOfDay = wt.hour + wt.minute / 60 - (disableDst || (timing !== Timing.MODERN && timing !== Timing.CONSTRAINED_SUN) ? wt.dstOffset / 3600 : 0); const handAngle = _hourOfDay * 15 - 180; const baseSunAngle = solarSystem.getEclipticPosition(SUN, _jde).longitude.degrees; const baseMoonAngle = solarSystem.getEclipticPosition(MOON, _jde).longitude.degrees; - const sunAngle = adjustForEclipticWheel(baseSunAngle); - const moonAngle = adjustForEclipticWheel(baseMoonAngle); + const sunAngle = adjustForEclipticWheel(baseSunAngle, southern); + const moonAngle = adjustForEclipticWheel(baseMoonAngle, southern); const siderealAngle = observer.getLocalHourAngle(_jdu, true).degrees - 90; - const moonPhase = mod((baseMoonAngle - baseSunAngle) * rotateSign, 360); + const moonPhase = mod(baseMoonAngle - baseSunAngle, 360); const moonHandAngle = calculateMoonHandAngle(moonAngle.ie, siderealAngle); const _constrainedSunAngle = calculateEclipticAnglesFromHandAngle(handAngle, siderealAngle);