From c1d2d1805a6313c25b49240fae62b68df8e4b89e Mon Sep 17 00:00:00 2001 From: miguel Date: Sun, 22 Nov 2020 12:59:52 +1100 Subject: [PATCH] Update magloop.html Added calculated loop area. Added spaces between numbers and units in text. --- magloop.html | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/magloop.html b/magloop.html index 7db70fd..18c9973 100644 --- a/magloop.html +++ b/magloop.html @@ -505,13 +505,13 @@ fctx.fillText("L = " + L.toPrecision(3).toString() + " \u03bcH", 8, 18); // Write Tx power text: - fctx.fillText("Tx = " + transmit_power_slider.value + "W", 8, win_height * 0.8 + 20); + fctx.fillText("Tx = " + transmit_power_slider.value + " W", 8, win_height * 0.8 + 20); // Write loop diameter symbol: fctx.font = "12px arial"; fctx.textAlign = "center"; const dia = 1.0 * loop_diameter_slider.value; - fctx.fillText("\u2300b = " + dia.toPrecision(3).toString() + "m", loopx, loopy - 6); + fctx.fillText("\u2300b = " + dia.toPrecision(3).toString() + " m", loopx, loopy - 6); // Draw conductor diameter arrow: fctx.beginPath(); @@ -548,7 +548,11 @@ p1y = loopy + 0.4 * (loop_radius - cond_radius) - 5; //fctx.textAlign = "right"; const cond_dia = 1.0 * conductor_diameter_slider.value; - fctx.fillText("\u2300a = " + cond_dia.toPrecision(3).toString() + "mm", loopx, p1y+2); + fctx.fillText("\u2300a = " + cond_dia.toPrecision(3).toString() + " mm", loopx, p1y+2); + + // Write loop area: + fctx.textAlign = "right"; + fctx.fillText("A = " + (Math.PI * dia**2).toPrecision(3).toString() + " m\u00B2", win_width-8, 18); } const aside_canvas = document.getElementById("antennaSide2D"); @@ -626,7 +630,7 @@ // Draw spacing text: sctx.textAlign = "center"; const spc = loop_spacing_slider.value * conductor_diameter_slider.value; - sctx.fillText("c = " + spc.toPrecision(3).toString() + "mm", start_x + cond_spacing, dim_y + 20); + sctx.fillText("c = " + spc.toPrecision(3).toString() + " mm", start_x + cond_spacing, dim_y + 20); } drawFrontDesign(); drawSideDesign();