feet =
inches =
meters
meters (assuming "metric feet")
Some quick tips to get you started:
Expressions can contain numbers, units and the operators
+ - * /
and ^ (exponentiation).
Multiplication and division are performed before addition and subtraction, and
parenthesis can be used for grouping. Spaces are generally optional.
Units include:
ft ' in "
m and cm.
As you type, the expression might be momentarily unparsable, e.g.,
“3'+”, until you finish typing.
The results box will be grayed out while that happens.
It would be too noisy to alert each of these errors, but if you don't
know why it's grayed out, you can hit “enter” to see an error message.
If you realize you should have begun a parenthesized expression and enter
10'4" + 4'2"), the opening parenthesis will be provided automatically
so that you don't have to go back and add it yourself (which is annoying on mobile devices).
In these help boxes most sample expressions, like
11'4"/2, can be clicked to evaluate the expression.
| Example | Description |
| 5' 6" | An ordinary distance |
| 5' 6 3/8" / 3 | Divide 5 feet 6 and 3/8 inches by 3 |
| 5 1/2' - 8" | Subtracts lengths |
| 5.5' | You can use decimal values instead of fractions |
| 3/4" | You can use just a fraction |
| (5'6" + 7') / 2 | The average of 5'6" and 7' |
| 5' 10 3/8" * 3/4 | 3/4 of 5' 10 3/8" |
| 12' / 6" | The ratio of 12' and 6" |
| 1 + 2 * 3 | Ordinary math (note order of operations; result is 7) |
| (1 + 2) * 3 | Result is 9 |
| 1m - 2cm | One meter minus two centimeters |
| ft | A foot |
| ft * 8 | 8 feet; notice that named units are simply variables that have units |
| 5' 6" * pi | Circumference of a 5' 6" diameter circle |
| hyp(3', 4') | Hypotenuse of a right triangle with sides 3' and 4' (result is 5') |
| 1/4 mi2 / acres | The number of acres in a quarter of a square mile |
Try furlongs/fortnight or gallons/cup.
Units are either the notations ' and " for
feet and inches or a named unit.
The full list
of predefined units and constants is too long to show here.
Any variable you define can be used as a unit itself.
For example, if you enter cubit = 1 1/2', you can then use
expressions like 3 cubit 5 1/2".
A unit can be immediately followed (without spaces) by a number which is
the power of that unit. For instance, 3 yd2 is three square yards
(27 square feet)
and 2 ft3 is two cubic feet. If a unit specifier is immediately
preceded by a / (without spaces), it's an inverse unit.
For instance, 60 /ft2 means 60 per square foot.
144 /ft2 means 144 per square foot or, equivalently, 1 per square inch
(which is how it will display). What per square foot? Anything.
Think “ducks” or “pebbles” and you'll be on the right track.
In fact, you can type 640 'ducks' / mi2 or 144 'pebble'/ft2.
(Bear in mind that 'pebble' is a different unit from 'pebbles'.)
Try 2 'shoes'/person * 1000 people.
If there's some unit this tool didn't anticipate, you can define it yourself,
bogosity = 'bogosity' and use it as an ordinary unit such as 20 bogosity.
Beware that spaces can occasionally make a big difference.
1/2 in or 1/2in means half an inch,
but 1 / 2 in or even
1/ 2 in means one over 2 inches. Just avoid putting spaces around
the slash in a fractional unit and you'll be fine.
To display results in terms of specific units, follow an expression by :
then a unit or series of units.
For instance, 100 km/hr : mi displays the speed in miles/minute.
100 km/hr : mi/hr displays the speed in terms of miles/hour.
The special units mks, cgs and uscu
request results in the those systems, e.g. 60 mi/hr : mks.
10 horsepower : W, alternatively
10 horsepower : mks
cup : tbsp
tbsp : cup
atm : PSI
20 celsius : fahrenheit
0K : degf
20000 league : mi.
That's deep!
pi/4 radians in degrees? pi/4 radians : degrees
ecost = 0.20$ / kWh)?
That would be, ecost * 100 watts : year, about $175. Use LEDs!
ecost * 65W : month
ecost * 450 watt : hr
ecost * .5 watt : yr
ecost * 3000 watt : min, just one cent.
45 mi/gallon : km/liter
3 'meals'/day : yr
kg/liter*gallon : lb
kB/m : km.
It seems rather silly, but it might be a length of magnetic tape
9600 baud * 1 bit/symbol
au : mi
au/c : min
femtolightyear : yards
5V across a 2000 ohm resister?
5V / 2000 ohm
33 1/3 RPM : degrees/second
ISK = .008$
and gas costs 220 ISK/liter; what's that in dollars per gallon?
220 ISK/liter : $/gallon
$ : ISK
As an exercise, suppose an elephant weighs elephantWeight = 8000lbf
(I've used pounds of force) and an elephant's foot is about
elephantFoot = 45cm across, and it's standing evenly on four legs,
then the pressure under its feet, expressed in pounds per square inch, is
elephantWeight/(pi*(elephantFoot/2)^2)/4 : PSI, about 8 PSI.
To define variables type name = expression
then hit “enter.”
For instance, frontage = 45'4 3/4". You can then use those values
in later expressions, e.g. frontage/3.
And because frontage is a length, it can also be
used as a unit: 1/3 frontage or 1/3frontage.
The variables ft, in, m, cm,
etc. described in "Units" above
are predefined for use as values or as units. The variable pi is
predefined in case you care about circles.
Reserved
predefined variables cannot be changed.
Define functions to automate routine calculations by typing
name(param,param,…) = expression
then hitting “enter.” For instance, you can define a function to average to numbers
or lengths: average(x,y) = (x+y)/2 (but the predefined function
mean(…) already does that, so…).
Functions can refer to their parameters and to variables.
As a special case, a function with no parameters can be used as a
“dynamic variable.” That is, assuming variables a
and b are defined
(say, a = 2 and b = 3), the function
ab() = a + b can be invoked as ab() or ab,
and in either case gives you the current value of a + b.
If you change either variable (say, b = 5), then the
value ab changes too.
| Function | Description |
|---|---|
| mean(x,y,…) | The average of a set of numbers or dimensional values |
| sum(x,y,…) | The average of a set of numbers or dimensional values |
| hyp(x,y,…) | The hypotenuse of a triangle or, more usefully, the diagonal of a rectangle |
| sqrt(x) | Square root |
| cbrt(x) | Cube root |
| sin(angle) | Sine of an angle (must be units of radians or degrees or a plain number) |
| cos(angle) | Cosine of an angle (must be units of radians or degrees or a plain number) |
| atan2(y, x) | Returns the angle corresponding to the slope y/x, even when x is zero. More formally, it's the angle from the x-axis of the vector (x,y). |
For the purposes of this tool, angles are neither degrees nor radians.
They are just angles and can be
specified or displayed using either notation. If a plain number is given, it will be
interpreted as radians. So sin(45 degrees), sin(pi/4radian)
and sin(pi/4) all mean the same thing.
Results presented in feet and inches show an alternate interpretation assuming measurements are in "metric feet." A “metric foot” is a convention used by the construction industry in metric countries where a foot is taken to be exactly 30cm instead of 30.48cm. It's an international standard.
Boring details, if you're interested.
This program started out as a quick and dirty tool to easily divide
lengths given in feet and inches into equal parts, a common task
in the construction industry and quite tedious to work out by hand.
If the file name or URL contains the string "inch",
you'll see the original user interface. If you're curious, you can
switch the UI.
But I started to think of it as a calculator and wondered
if it could be generalized to do arbitrary math with lengths.
It's possible to add two lengths,
resulting in another length, or to multiply or divide a length by a number.
But you can't add a length and a number.
You can divide a length by a length to get a number (the ratio of lengths).
Can you multiply two lengths? Yes, but the result is an area.
This line of thinking leads to
dimensional analysis,
and there are already some very good programs out there for that including the legendary
Unix "units" command.
Hell,
Google will do it for you if you ask it nicely. But I couldn't
help myself, so I got carried away and ended up implementing a fairly
general dimensional units calculator.
Various interesting problems came up along the way, including issues of
special-purpose language design, grammar ambiguity, and maintaining full
decimal precision in calculations
(remember that 0.1 can't be represented exactly in binary floating point).
As an example of using ambiguity for profit, there seemed to be no principled
reason to forbid using a dimensionless number as a unit and allowing it
lets you define the function Still, the main distinction of this tool is that it deals naturally with notations
typically used with feet and inches. But, sigh,
Google will do that for you too.
Contra the NIST, and in accordance with conventional usage, this program treats
Traditional volume units are problematic. There are differences between
wet and dry gallons and futhermore differences between US and UK units.
"Barrels" depend on what's in them. Fruits and vegetables are pretty simple,
unless it's cranberries.
Altogether, the situation is rather hopeless and by default I've chosen relatively
uncontroverial wet US volume units and excluded dry units entirely.
The SI system treats angles as dimensionless quantities, perhaps because they don't
actually measure anything. But treating them as if they were units allows
dealing with things like This program is unapologetically biased toward US conventional units since
it was originally conceived as a tool to deal with their difficulty; nobody else
has problems with units calculations.
Still, I've tried to encompass the entire SI system and as much of the CGS system as possible.
Unfortunately, CGS has multiple extensions for electromagnetism, all different from each other
and from SI. Worse still, certain CGS electromagnetic units use half-integer dimension exponents
and that's a thornier kind of dimensional analysis than this program can handle.
You can download this app locally as
UnitsCalc or
FeetInchCalc.
You can also
run this app from the web.
A-B-C. A-Always. B-Be. C-Coding.
Copyright © 2021, Stan Switzer
Icon made by Freepik
from www.flaticon.com.
The SI Units Logo, from the BIPM, is
CC BY-ND 4.0.
circleArea(r) = 𝜋 r2
or write 17 mol.
acres, chains, furlongs, townships, etc.
as if they were defined in terms of modern feet. But in fact
they're defined in terms of the anachronistic
"survey foot"
and there's a suite of
survey units
with their, arguably proper, definitions:
surveyacre, surveychain, surveyrod,
etc.
In practice, usage varies by state and is
currently undergoing changes. It's a mess.
revolutions / minute ,
converting degrees to radians,
and, to be fair, makes some sense when thinking about things like the
reduced Planck constant (ℏ).
Even the SI is torn because units of luminosity
(lux and lumen) use the steradian.
So, for practical reasons more than principled ones, this
tool treats angles as if they were dimensional.
Splitting the differences among the different angular units systems, I use
the circle, a full revolution, as the basis unit for angles.
Find source on
GitHub
Symbols that are reserved (that is, cannot be redefined) are noted.
| Symbol | Description |