Function Repository Resource:

TapeMeasureNumberLinePlot

Source Notebook

Show a length on a tape measure and give the closest ruler fractions

Contributed by: Gustavo Delfino

ResourceFunction["TapeMeasureNumberLinePlot"][inches]

plots the distance inches in a measuring tape styled number line, also showing the closest ruler fractions.

Details

TapeMeasureNumberLinePlot works with Imperial units (inches, feet, yards etc.) and does not support metric measures.
The input is meant to be a real number representing a length in inches.
The plot includes the closest 4th, 8th, 16th, 32th of an inch.
The plot provide a button that will show a dataset. It includes the errors in each approximation and also shows the closest 64th of an inch.
The closest millimeter precision distance is also shown. This is useful for measurement tapes with dual scales.
The plot ranges between the nearest inch tick marks below and above the input.
Fractions having power of two denominators are known as dyadic rationals.

Examples

Basic Examples (2) 

Show a tape measure with fractions nearest to.4321 inches:

In[1]:=
ResourceFunction["TapeMeasureNumberLinePlot"][0.4321]
Out[1]=

Use the "Print Dataset" button for more details:

Scope (2) 

The distance can be larger than 1:

In[2]:=
ResourceFunction["TapeMeasureNumberLinePlot"][10.1234]
Out[2]=

Any numeric input is acceptable:

In[3]:=
Map[ResourceFunction[
  "TapeMeasureNumberLinePlot"], {1/3, Pi}] // Column

Applications (2) 

Note the zero mark on the vernier (with precision to the nearest thousandth of an inch):

Out[2]=

Find the closest fraction on a standard measuring tape:

In[4]:=
ResourceFunction["TapeMeasureNumberLinePlot"][0.293]
Out[4]=

Properties and Relations (2) 

Convert .293 to the nearest tape measure fraction:

In[5]:=
ResourceFunction["TapeMeasureNumberLinePlot"][0.293]
Out[5]=

Rationalize also converts to a fraction, but the resulting fraction denominator is not restricted to powers of 2:

In[6]:=
Rationalize[0.293, 1/32]
Out[6]=

Possible Issues (2) 

TapeMeasureNumberLinePlot cannot handle integers:

In[7]:=
ResourceFunction["TapeMeasureNumberLinePlot"][10]
Out[7]=

TapeMeasureNumberLinePlot returns unevaluated for nonpositive inputs:

In[8]:=
ResourceFunction["TapeMeasureNumberLinePlot"][0]
Out[8]=
In[9]:=
ResourceFunction["TapeMeasureNumberLinePlot"][-0.5]
Out[9]=

Neat Examples (1) 

A Manipulate to convert from tenths of an inch to imperial fractions:

In[10]:=
Manipulate[
 ResourceFunction["TapeMeasureNumberLinePlot"][x], {x, .1, .9, .1}]
Out[10]=

Publisher

GustavoDelfino

Requirements

Wolfram Language 13.0 (December 2021) or above

Version History

  • 1.1.0 – 09 October 2024
  • 1.0.0 – 01 July 2024

Related Resources

License Information