From 3f52e67f8ddb19850b01bda85bbbee50455df2fb Mon Sep 17 00:00:00 2001 From: miguel <31931809+miguelvaca@users.noreply.github.com> Date: Mon, 20 Mar 2023 23:41:59 +1100 Subject: [PATCH] Update short_antenna.html Draw an inductor symbol. --- short_antenna.html | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/short_antenna.html b/short_antenna.html index 21ccba7..604afd4 100644 --- a/short_antenna.html +++ b/short_antenna.html @@ -295,7 +295,8 @@ } function drawInductor(ctx, x, y, angle) { - const l1 = 15.0; + const l1 = 12.0; + /* ctx.beginPath(); ctx.moveTo(x + l1*Math.cos(angle-0.25*Math.PI), y + l1*Math.sin(angle-0.25*Math.PI)); ctx.lineTo(x + l1*Math.cos(angle+0.25*Math.PI), y + l1*Math.sin(angle+0.25*Math.PI)); @@ -303,6 +304,18 @@ ctx.lineTo(x + l1*Math.cos(angle+1.25*Math.PI), y + l1*Math.sin(angle+1.25*Math.PI)); ctx.lineTo(x + l1*Math.cos(angle-0.25*Math.PI), y + l1*Math.sin(angle-0.25*Math.PI)); ctx.stroke(); + */ + ctx.clearRect(x-l1,y-l1,2*l1,2*l1); + ctx.beginPath(); + ctx.moveTo(x , y - l1); + ctx.arcTo(x + l1, y - l1, x + l1, y - 0.33 * l1, 0.5*l1); + ctx.arcTo(x + l1, y + 0.33 * l1, x, y + 0.33 * l1, 0.5*l1); + ctx.arcTo(x - l1, y + 0.33 * l1, x - l1, y, 0.25*l1); + ctx.arcTo(x - l1, y - 0.33 * l1, x , y - 0.33 * l1, 0.25*l1); + ctx.arcTo(x + l1, y - 0.33 * l1, x + l1, y + 0.33 * l1, 0.5*l1); + ctx.arcTo(x + l1, y + l1, x, y + l1, 0.5*l1); + ctx.lineTo(x, y + l1); + ctx.stroke(); } function drawArrow(ctx, x, y, angle) {