Is there any documentation on what consists of the unit system "SIBase"
,"Imperial"
, "SI"
and "Metric"
in the UnitConvert
function, and the rule of what unit is returned in the results? Cause I have notices in doing UnitConvert[Quantity[x, LengthUnit], "Metric"]
sometimes returns quantity with units in m, and other times in mm.
1 Answer
i dont know about documentation, but "Metric" and "SI" appear to be the same and give a unit based on the magnitude, while "SIBase" consistently gives meters.
UnitConvert[Quantity[#, "feet"], "Metric"] & /@ {.00001, 0.001,
0.01, .1, 1., 10., 10000.}
{Quantity[3.048, "Micrometers"], Quantity[304.8, "Micrometers"], Quantity[3.048, "Millimeters"], Quantity[3.048, "Centimeters"], Quantity[30.48, "Centimeters"], Quantity[3.048, "Meters"], Quantity[3.048, "Kilometers"]}
UnitConvert[Quantity[#, "feet"], "SI"] & /@ {.00001, 0.001, 0.01, .1,
1., 10., 10000.}
{Quantity[3.048, "Micrometers"], Quantity[304.8, "Micrometers"], Quantity[3.048, "Millimeters"], Quantity[3.048, "Centimeters"], Quantity[30.48, "Centimeters"], Quantity[3.048, "Meters"], Quantity[3.048, "Kilometers"]}
UnitConvert[Quantity[#, "feet"], "SIBase"] & /@ {.00001, 0.001,
0.01, .1, 1., 10., 10000.}
{Quantity[3.048*10^-6, "Meters"], Quantity[0.0003048, "Meters"], Quantity[0.003048, "Meters"], Quantity[0.03048, "Meters"], Quantity[0.3048, "Meters"], Quantity[3.048, "Meters"], Quantity[3048., "Meters"]}
The base unit itself plays into the heuristic as well, example:
UnitConvert[Quantity[.158125 10.^-4, "light year"], "Metric"] -> 1. au
UnitConvert[Quantity[93. 10^6, "Miles"], "Metric"] -> 1.49669 10^8 km