diff --git a/short_antenna.html b/short_antenna.html index 4f7b413..4c475c2 100644 --- a/short_antenna.html +++ b/short_antenna.html @@ -38,29 +38,13 @@ slider widgets.

Inputs via the slider widgets: -

Characteristics on the left are independent of frequency, while the characteristics on the right are dependent on the selected frequency.

- Each of the graphic representations attempt to keep the relative geometry correct, without exceeding the drawing boundary. The coil diameter - relative to the conductor diameter are representative.

- Calculated dimensions: - - Calculated parameters: - +

Top left is the length of a single antenna element. (Not including the coil length.)
+ Top right is the length of the entire dipole. (Not including the coil length.))

@@ -320,6 +304,20 @@ ctx.stroke(); } + function getFeetAndInchesFromMeters(inMeters) { + // + var inFeet = Math.trunc(inMeters * 3.28084); + var inchesLeft = (inMeters - (inFeet / 3.28084)) * 39.37008; + return inFeet.toString() + inchesLeft.toFixed(2).toString(); + } + + function getFeetAndInchesFromFeet(inFeet) { + // + var wholeFeet = Math.trunc(inFeet); + var inches = (inFeet - wholeFeet) * 12.0; + return wholeFeet.toString() + "\' " + inches.toFixed(1).toString() + "\""; + } + const afront_canvas = document.getElementById("inductor2D"); const fctx = afront_canvas.getContext('2d'); @@ -371,16 +369,20 @@ drawInductor(fctx, wire_x, d_pos, 0.0*Math.PI); drawArrow(fctx, wire_x - 30, d_pos, 0.5*Math.PI); fctx.fillText(dipole.distance_meters.toFixed(2).toString() + " m", wire_x - 60, d_pos + 12 ); - fctx.fillText(dipole.distance_feet.toFixed(2).toString() + " ft", wire_x - 60, d_pos - 4); + //fctx.fillText(dipole.distance_feet.toFixed(2).toString() + " ft", wire_x - 60, d_pos - 4); + fctx.fillText(getFeetAndInchesFromFeet(dipole.distance_feet), wire_x - 60, d_pos - 4); drawArrow(fctx, wire_x - 30, up_wire_bot_y, 0.5*Math.PI); fctx.fillText("0.00", wire_x - 60, up_wire_bot_y + 5); //fctx.fillText("0.00 m", wire_x - 60, up_wire_bot_y + 18); drawArrow(fctx, wire_x - 30, up_wire_top_y, 0.5*Math.PI); - fctx.fillText((dipole.length_feet * 0.5).toFixed(2).toString() + " ft", wire_x - 60, up_wire_top_y - 4); + + //fctx.fillText((dipole.length_feet * 0.5).toFixed(2).toString() + " ft", wire_x - 60, up_wire_top_y - 4); + fctx.fillText(getFeetAndInchesFromFeet(dipole.length_feet * 0.5), wire_x - 60, up_wire_top_y - 4); fctx.fillText((dipole.length_meters * 0.5).toFixed(2).toString() + " m", wire_x - 60, up_wire_top_y + 12); fctx.textAlign = "left"; - fctx.fillText(dipole.length_feet.toFixed(2).toString() + " ft", wire_x + 60, up_wire_top_y - 4); + //fctx.fillText(dipole.length_feet.toFixed(2).toString() + " ft", wire_x + 60, up_wire_top_y - 4); + fctx.fillText(getFeetAndInchesFromFeet(dipole.length_feet), wire_x + 60, up_wire_top_y - 4); fctx.fillText(dipole.length_meters.toFixed(2).toString() + " m", wire_x + 60, up_wire_top_y + 12); //fctx.fillText("0.00 ft", wire_x + 60, down_wire_bot_y ); fctx.fillText("0.00", wire_x + 60, down_wire_bot_y + 5);