HP Forums
Diameter of an American Wire Gauge - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Software Libraries (/forum-10.html)
+--- Forum: HP Prime Software Library (/forum-15.html)
+--- Thread: Diameter of an American Wire Gauge (/thread-12016.html)



Diameter of an American Wire Gauge - Eddie W. Shore - 12-24-2018 01:58 AM

Blog post: https://edspi31415.blogspot.com/2018/12/casio-fx-5800p-and-hp-prime-american.html

Introduction

The following formula calculates the diameter of an American Wire Gauge:

d = 460 / (92^((3 + g)/39)) (in mils)

where g is the wire number (integer).

Define g as:
Wire number: 0000000, g = -6
Wire number: 000000, g = -5
Wire number: 00000, g = -4
Wire number: 0000, g = -3
Wire number: 000, g = -2
Wire number: 00, g = -1
Wire number: 0, g = 0
Any other wire number, enter g as the wire number (1, 2, 3, 4, etc.)

Conversion factor: 1000 mils = 1 in

HP Prime Program Function AWB

Given the wire number, the function AWB returns the diameter of the wire in inches.
Code:

EXPORT AWG(g)
BEGIN
// American Wire Gauge Diameter Function
// 2018-12-23 EWS
// in inches
RETURN (460/(92^((3+g)/39)))/1000;
END;
Examples:

g = -2 (000); d ≈ 0.4096 in
g = 3; d ≈ 0.2294 in
g = 6; d ≈ 0.1620 in


Sources:

Ball, John A. Algorithms For RPN Calculators John Wiley & Sons: New York 1978. ISBN 0-471-03070-8

Glover, Thomas J. Pocket Ref 4th Edition Sequoia Publishing, Inc.: Littleton, CO 2012. ISBN 978-1-885071-62-0