Komet in Sternnenhimmel gefixt
This commit is contained in:
@@ -1683,13 +1683,16 @@ function drawComets(date) {
|
|||||||
comet._xy = pt;
|
comet._xy = pt;
|
||||||
comet._pos = pos;
|
comet._pos = pos;
|
||||||
|
|
||||||
// Schweifrichtung: vom Sonnenzentrum weg (Näherung über Sonnenazimut)
|
// Schweifrichtung: vom Sonnenzentrum weg (auch wenn Sonne unter dem Horizont)
|
||||||
let tailAngle = -Math.PI * 0.65;
|
let tailAngle = -Math.PI * 0.65;
|
||||||
if (sunCache && Number.isFinite(sunCache.az)) {
|
if (sunCache && Number.isFinite(sunCache.az) && Number.isFinite(sunCache.alt)) {
|
||||||
const sunPt = project(sunCache.alt, sunCache.az);
|
// Virtuelle Sonnenposition berechnen – ohne Horizont-Prüfung,
|
||||||
if (sunPt) {
|
// damit der Schweif auch bei Nacht korrekt von der Sonne weg zeigt
|
||||||
tailAngle = Math.atan2(pt.y - sunPt.y, pt.x - sunPt.x);
|
const sunRho = (90.0 - sunCache.alt) / 90.0;
|
||||||
}
|
const sunAzR = sunCache.az * Math.PI / 180.0;
|
||||||
|
const sunVX = cx - sunRho * R * Math.sin(sunAzR);
|
||||||
|
const sunVY = cy - sunRho * R * Math.cos(sunAzR);
|
||||||
|
tailAngle = Math.atan2(pt.y - sunVY, pt.x - sunVX);
|
||||||
}
|
}
|
||||||
// Schweifläng: sonnennah = lang, sonnenfern = kurz (20/rH AU, Bereich 6–55 px)
|
// Schweifläng: sonnennah = lang, sonnenfern = kurz (20/rH AU, Bereich 6–55 px)
|
||||||
const tailLen = pos.rH > 0 ? Math.max(6, Math.min(55, 20 / pos.rH)) : 12;
|
const tailLen = pos.rH > 0 ? Math.max(6, Math.min(55, 20 / pos.rH)) : 12;
|
||||||
|
|||||||
Reference in New Issue
Block a user