fix(geom9 ch1): эмодзи в §4 + подписи в единицах в §6

§4 IV1: бейдж тупого угла использовал эмодзи ⚠ — заменён
на inline SVG треугольника-предупреждения (правило проекта:
никаких эмодзи в коде, только inline SVG).

§6 IV1: подписи длин рисовались в пикселях
(b₁=120, h=80 и т.д.) и из них проверялись соотношения —
бессмысленные числа. Теперь все подписи в реальных единицах
(гипотенуза c=10), соотношения тоже в единицах.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
Maxim Dolgolyov
2026-05-29 10:53:59 +03:00
parent da14b9cb68
commit 0d1474f0f5
+12 -12
View File
@@ -1686,7 +1686,7 @@ function buildP4(){
+ (tn===null ? '$\\tan '+aDeg+'^\\circ$ — не определён' : '$\\tan '+aDeg+'^\\circ \\approx '+tn.toFixed(3)+'$');
renderMath(out);
if(aDeg > 90 && aDeg < 180){
tag.innerHTML = '<span style="color:var(--pri2);background:var(--pri-soft);padding:5px 12px;border-radius:8px">⚠ Тупой угол! $\\cos \\alpha < 0$.</span>';
tag.innerHTML = '<span style="color:var(--pri2);background:var(--pri-soft);padding:5px 12px;border-radius:8px;display:inline-flex;align-items:center;gap:6px"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" style="width:14px;height:14px"><path d="M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"/><line x1="12" y1="9" x2="12" y2="13"/><line x1="12" y1="17" x2="12.01" y2="17"/></svg> Тупой угол! $\\cos \\alpha < 0$.</span>';
renderMath(tag);
} else if(aDeg === 90){
tag.innerHTML = '<span style="color:#065f46;background:var(--ok-bg);padding:5px 12px;border-radius:8px">Прямой угол.</span>';
@@ -2262,18 +2262,18 @@ function buildP6(){
s += '<text x="'+(B.x+12)+'" y="'+(B.y+18)+'" text-anchor="start" font-family="Inter,sans-serif" font-size="15" font-weight="700">B</text>';
s += '<text x="'+C.x+'" y="'+(C.y-10)+'" text-anchor="middle" font-family="Inter,sans-serif" font-size="15" font-weight="700">C</text>';
s += '<text x="'+H.x+'" y="'+(H.y+18)+'" text-anchor="middle" font-family="Inter,sans-serif" font-size="13" font-weight="700" fill="#dc2626">H</text>';
// подписи отрезков
s += '<text x="'+((A.x+H.x)/2)+'" y="'+(A.y+32)+'" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="11" fill="#0ea5e9">b₁='+b1.toFixed(0)+'</text>';
s += '<text x="'+((H.x+B.x)/2)+'" y="'+(A.y+32)+'" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="11" fill="#ec4899">a₁='+a1.toFixed(0)+'</text>';
s += '<text x="'+(H.x+10)+'" y="'+((C.y+H.y)/2)+'" text-anchor="start" font-family="JetBrains Mono,monospace" font-size="11" fill="#dc2626">h='+hPx.toFixed(0)+'</text>';
s += '<text x="'+((A.x+C.x)/2 - 14)+'" y="'+((A.y+C.y)/2)+'" text-anchor="end" font-family="JetBrains Mono,monospace" font-size="11" fill="#b45309">b='+bPx.toFixed(0)+'</text>';
s += '<text x="'+((B.x+C.x)/2 + 14)+'" y="'+((B.y+C.y)/2)+'" text-anchor="start" font-family="JetBrains Mono,monospace" font-size="11" fill="#b45309">a='+aPx.toFixed(0)+'</text>';
// подписи отрезков в единицах (px / sc = единиц, c = 10)
s += '<text x="'+((A.x+H.x)/2)+'" y="'+(A.y+32)+'" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="11" font-weight="700" fill="#0ea5e9">b₁='+_b1.toFixed(2)+'</text>';
s += '<text x="'+((H.x+B.x)/2)+'" y="'+(A.y+32)+'" text-anchor="middle" font-family="JetBrains Mono,monospace" font-size="11" font-weight="700" fill="#ec4899">a₁='+_a1.toFixed(2)+'</text>';
s += '<text x="'+(H.x+10)+'" y="'+((C.y+H.y)/2)+'" text-anchor="start" font-family="JetBrains Mono,monospace" font-size="11" font-weight="700" fill="#dc2626">h='+h.toFixed(2)+'</text>';
s += '<text x="'+((A.x+C.x)/2 - 14)+'" y="'+((A.y+C.y)/2)+'" text-anchor="end" font-family="JetBrains Mono,monospace" font-size="11" font-weight="700" fill="#b45309">b='+b.toFixed(2)+'</text>';
s += '<text x="'+((B.x+C.x)/2 + 14)+'" y="'+((B.y+C.y)/2)+'" text-anchor="start" font-family="JetBrains Mono,monospace" font-size="11" font-weight="700" fill="#b45309">a='+a.toFixed(2)+'</text>';
svg.innerHTML = s;
// соотношения (в пикселях — но проверка работает в любых единицах)
out.innerHTML = '<b>Три соотношения (в пикселях):</b><br>'
+ '$h^2 = '+hPx.toFixed(0)+'^2 \\approx '+(hPx*hPx).toFixed(0)+'$, &nbsp; $a_1 \\cdot b_1 = '+a1.toFixed(0)+' \\cdot '+b1.toFixed(0)+' \\approx '+(a1*b1).toFixed(0)+'$ &nbsp;✓<br>'
+ '$a^2 = '+aPx.toFixed(0)+'^2 \\approx '+(aPx*aPx).toFixed(0)+'$, &nbsp; $c \\cdot a_1 = '+cPx+' \\cdot '+a1.toFixed(0)+' \\approx '+(cPx*a1).toFixed(0)+'$ &nbsp;✓<br>'
+ '$b^2 = '+bPx.toFixed(0)+'^2 \\approx '+(bPx*bPx).toFixed(0)+'$, &nbsp; $c \\cdot b_1 = '+cPx+' \\cdot '+b1.toFixed(0)+' \\approx '+(cPx*b1).toFixed(0)+'$ &nbsp;✓';
// соотношения в реальных единицах (c = 10)
out.innerHTML = '<b>Три соотношения (гипотенуза $c = '+c.toFixed(0)+'$):</b><br>'
+ '$h^2 = '+h.toFixed(2)+'^2 \\approx '+(h*h).toFixed(2)+'$, &nbsp; $a_1 \\cdot b_1 = '+_a1.toFixed(2)+' \\cdot '+_b1.toFixed(2)+' \\approx '+(_a1*_b1).toFixed(2)+'$ &nbsp;✓<br>'
+ '$a^2 = '+a.toFixed(2)+'^2 \\approx '+(a*a).toFixed(2)+'$, &nbsp; $c \\cdot a_1 = '+c.toFixed(0)+' \\cdot '+_a1.toFixed(2)+' \\approx '+(c*_a1).toFixed(2)+'$ &nbsp;✓<br>'
+ '$b^2 = '+b.toFixed(2)+'^2 \\approx '+(b*b).toFixed(2)+'$, &nbsp; $c \\cdot b_1 = '+c.toFixed(0)+' \\cdot '+_b1.toFixed(2)+' \\approx '+(c*_b1).toFixed(2)+'$ &nbsp;✓';
renderMath(out);
seen.add(Adeg);
if(seen.size >= 5 && !seen.has('done')){ addXp(10,'p6-iv1'); bumpProgress('p6', 15); seen.add('done'); }