Objective
Given a dimension of an SI unit, convert the Lorentz-Heaviside version of a Planck unit \$1\$ into SI metric.
What is a Planck unit?
Planck units are a set of units of measurement. It defines five fundamental constants of the universe as dimensionless \$1\$.
What is a dimension?
There are five types of fundamental dimension: L
, M
, T
, Q
, and Θ
(U+0398; Greek Capital Letter Theta).
L
stands for length and corresponds to SI unit m (meter).
M
stands for mass and corresponds to SI unit kg (kilogram).
T
stands for time and corresponds to SI unit s (second).
Q
stands for electric charge and corresponds to SI unit C (Coulomb).
Θ
stands for temperature and corresponds to SI unit K (Kelvin).
A dimension is a multiplicative combination of these. For example, SI unit V (volt) is same as kg·m²·C/s⁴ and thus corresponds to dimension L²MQ/T⁴
.
Planck to SI
\$1\$ as Planck unit can be converted to SI metric as follows:
$$ 1 = 5.72938×10^{−35} \space [\text{m}] = 6.13971×10^{−9} \space [\text{kg}] = 1.91112×10^{−43} \space [\text{s}] = 5.29082×10^{−19} \space [\text{C}] = 3.99674×10^{31} \space [\text{K}] $$
Input and Output
A dimension is given as the input. Its type and format doesn't matter. In particular, it can be an size-5 array of signed integers, each integer representing the exponent of a fundamental dimension.
The Planck unit \$1\$ is to be converted to the SI unit that corresponds to the inputted dimension, and then outputted. The output type and format doesn't matter.
Examples
Let's say the input format is a tuple of five integers, representing L
, M
, T
, Q
, and Θ
, respectively.
For example, If the input is \$(2,1,-1,-2,0)\$, it corresponds to SI unit Ohm, and thus:
$$ 1 = \frac{(5.72938×10^{−35})^2 × (6.13971×10^{−9})}{(1.91112×10^{−43})×(5.29082×10^{−19})^2} \space [\text{Ω}] $$
So the output is approximately \$376.730\$.
For another example, if the input is \$(-2,-1,3,0,1)\$, it corresponds to SI unit K/W, and thus:
$$ 1 = \frac{(1.91112×10^{−43})^3 × (3.99674×10^{31})}{(5.72938×10^{−35})^2 × (6.13971×10^{−9})} \space [\text{K/W}] $$
So the output is approximately \$1.38424×10^{−20}\$.
Note that, if the input is \$(0,0,0,0,0)\$, the output must be \$1\$.
10**-34.241892
, where can I cut off the34.241892
? If I cut it off to five decimal places as34.24189
, then the result of5.72941129637e-35
isn't quite accurate to five places. Sorry to be so finicky here, but this does seem to matter for answers I'm trying. \$\endgroup\$