New Primary and Secondary Conversions:
If you choose to add your own custom conversions to Unit Converter, it is
very important that you understand
how Unit Converter calculates conversions.
This program allows you to calculate over 100,000 different conversions
among over 1,000 different measurement units, but that does not mean that there
are 100,000 different conversion factors programmed in.
Rather, a small number of measurement units are designated as Primary
conversion units and all other units in that measurement class are designated
Secondary conversion units. The
conversion calculation then becomes a three-step process:
As an example, imagine that you want to convert from Kilometers to Miles.
The Length measurement class has 77 units, but only two of these
are Primary conversion units. The
two primary conversion units for Length are Feet and Meters, and all
units in the Length measurement class have a conversion factor to either
Feet or Meters. Your conversion
from Kilometers to Miles would go as follows:
If you wanted to convert from Centimeters to Inches, the conversion would
follow the same three-step process, with both Centimeters and Inches initially
being converted to Meters and Feet:
Conversions don’t have to convert between different primary conversion
units. If you want to convert
between Miles and Inches, the same three-step process would apply but the
Primary conversion factor would be 1:
This three-step conversion process is very useful in two respects.
First, it makes the initial programming much simpler and database size
much smaller, in that the number of conversion factors necessary in the database
is reduced from over 100,000 to a little over 1,100.
Second, it gives the user the ability to add a measurement unit to a
measurement class, enter a single conversion factor for that unit, and then be
able to convert from that unit to all other units in that class.
For example, if a user wanted a unit called a “half-meter”, then they
could enter in a conversion factor for Half-meter to convert it to an
appropriate primary conversion unit (Meter), and then they would be able
to convert Half-meters to and from all 77 other length units.
Unit Converter allows you to create new measurement classes with associated Primary Conversion units. If you plan on creating a new measurement class with several Secondary conversion units in it, consider carefully what would be your most appropriate Primary conversion units. If you can break down your secondary measurement units into two broad groups, then consider assigning a representative unit from each group as the two Primary conversion units.
For example, in the Length measurement class, I identified two
broad groups of Length measurements that could be generally categorized as Metric
and Standard. Most Metric
units had exact conversions among themselves, as did most Standard units.
Therefore I made one of the Primary Conversion units a Metric unit (Meters)
and the other Primary Conversion unit a Standard unit (Feet).
The advantage of doing it this way is that any Metric-to-Metric
conversions (such as Centimeters to Kilometers) are done entirely with exact
conversions (Centimeters à Meters à
Meters à Kilometers) and any Standard-to-Standard conversions (such as Inches to Miles)
are also done entirely with exact conversions (Inches à Feet à Feet à Miles).
If I had made both Primary conversion units to be Metric units, then any
Standard-to-Standard conversions would have suffered some from the fact that
there is no exact conversion going from Standard to Metric.
For example, if my Primary conversion units were Meters and Centimeters,
and I wanted to convert from Inches to Feet, the three-step conversion would
probably go as follows:
This would still give precise results, and accurate to many decimal
places, but it’s still not as good as it could be.
It’s a better strategy to include all measurement units with exact
conversions in a single broad group, and have a single Primary Conversion unit
represent all of them.