clear
d = 1.0;                       % line diameter (inches)
OD = 36.0;                       % pack outside diameter (inches)
ID = 12.0;                       % pack inside diameter (inches)
w = 30.;                      %  pack width between flanges (inches)
pack_factor = 1.15;                    % packing factor: 1.15 or 1.0

ir = ID / 2.0;
or = OD / 2.0;
layers = (pack_factor * (or - ir)) / d;     % number of layers
wraps = w / d;                 % number of wraps wide

len = 0.0;
for i = 1:layers,
  len = len + wraps * 2.0 * pi * (ir + ((i - 0.5) * d));
end
fprintf('Diameter = %5.3f\nWidth = %6.2f\nID = %6.2f\n', d, w, ID);
fprintf('OD = %6.2f\nLength = %8.2f feet  (%8.2f meters)\n', OD, len / 12.0, len * .0254);



