SWR${swr.toFixed(2)}:1
Reflected${(gamma * gamma * 100).toFixed(1)} %
Efficiency${effPct.toFixed(1)} %
`;
el.hidden = false;
}
function renderMetrics(el, result) {
if (!result) {
el.innerHTML = 'Nothing calculated yet.
';
return;
}
const { zin, gainDbi } = result;
const elev = 90 - result.maxTheta;
el.innerHTML = [
card('Feedpoint impedance', `${zin.r.toFixed(1)} ${zin.x >= 0 ? '+' : '−'} j${Math.abs(zin.x).toFixed(1)} Ω`,
'What your feed line sees. The j term is reactance; zero means resonant.'),
card('Peak gain', `${gainDbi.toFixed(2)} dBi`,
'dBi compares against an ideal point radiator. Over ground the figure already includes the reflection gain.'),
card('Take-off angle', `${elev.toFixed(0)}°`,
'Elevation of the strongest lobe. Low angles reach far, high angles go local.'),
].join('');
}
function renderWarnings(panel, list, warnings) {
const items = warnings ?? [];
if (items.length === 0) {
panel.hidden = true;
list.textContent = '';
return;
}
panel.hidden = false;
list.innerHTML = items.map((w) => `