Kometenanzeige verlängert

This commit is contained in:
2026-04-13 09:49:19 +02:00
parent 5f981d55a6
commit 10f363c48c
+8 -9
View File
@@ -1658,16 +1658,14 @@ function cometRaDec(comet, date) {
if (ra < 0) ra += 24;
const dec = Math.asin(gz / dist) * (180 / Math.PI);
// Helligkeit schätzen (HG-Modell wie in comets.py)
// Helligkeit + heliozentrische Distanz
const rH = Math.sqrt(xEq*xEq + yEq*yEq + zEq*zEq);
let mag = null;
if (comet.H !== null && comet.G !== null) {
const rH = Math.sqrt(xEq*xEq + yEq*yEq + zEq*zEq);
if (rH > 0 && dist > 0) {
mag = comet.H + 5*Math.log10(dist) + 2.5*comet.G*Math.log10(rH);
}
if (comet.H !== null && comet.G !== null && rH > 0 && dist > 0) {
mag = comet.H + 5*Math.log10(dist) + 2.5*comet.G*Math.log10(rH);
}
return { ra, dec, mag };
return { ra, dec, mag, rH };
}
function drawComets(date) {
@@ -1693,7 +1691,8 @@ function drawComets(date) {
tailAngle = Math.atan2(pt.y - sunPt.y, pt.x - sunPt.x);
}
}
const tailLen = 22;
// 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 tx = pt.x + Math.cos(tailAngle) * tailLen;
const ty = pt.y + Math.sin(tailAngle) * tailLen;
@@ -1731,7 +1730,7 @@ function drawComets(date) {
ctx.fillStyle = 'rgba(240,217,144,0.90)';
ctx.textAlign = 'left';
ctx.textBaseline = 'middle';
ctx.fillText(comet.name + magStr, pt.x + comaR * 2.5 + 4, pt.y - 6);
ctx.fillText(comet.name, pt.x + comaR * 2.5 + 4, pt.y - 6);
}
}
}