Kometenanzeige verlängert
This commit is contained in:
@@ -1658,16 +1658,14 @@ function cometRaDec(comet, date) {
|
|||||||
if (ra < 0) ra += 24;
|
if (ra < 0) ra += 24;
|
||||||
const dec = Math.asin(gz / dist) * (180 / Math.PI);
|
const dec = Math.asin(gz / dist) * (180 / Math.PI);
|
||||||
|
|
||||||
// Helligkeit schätzen (HG-Modell wie in comets.py)
|
// Helligkeit + heliozentrische Distanz
|
||||||
let mag = null;
|
|
||||||
if (comet.H !== null && comet.G !== null) {
|
|
||||||
const rH = Math.sqrt(xEq*xEq + yEq*yEq + zEq*zEq);
|
const rH = Math.sqrt(xEq*xEq + yEq*yEq + zEq*zEq);
|
||||||
if (rH > 0 && dist > 0) {
|
let mag = null;
|
||||||
|
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);
|
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) {
|
function drawComets(date) {
|
||||||
@@ -1693,7 +1691,8 @@ function drawComets(date) {
|
|||||||
tailAngle = Math.atan2(pt.y - sunPt.y, pt.x - sunPt.x);
|
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 tx = pt.x + Math.cos(tailAngle) * tailLen;
|
||||||
const ty = pt.y + Math.sin(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.fillStyle = 'rgba(240,217,144,0.90)';
|
||||||
ctx.textAlign = 'left';
|
ctx.textAlign = 'left';
|
||||||
ctx.textBaseline = 'middle';
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user