Replies: 1 comment 3 replies
-
@ericman314 do you have any thoughts on this? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is it possible to create a new unit for a new dimension but using existing units and constants?
I would like to create a unit for wavelengths of light convertible from and to the existing Hertz unit and using the speedOfLight constant to enable conversions such as:
const redFrequency = math.unit(385, 'terahz');
const redWavelength = redFrequency.to('nanometres'); // expected result approx 780
and vice versa. Basically we need to divide speedOfLight by hertz, both of which already exist in math.js but don't seem usable within a new unit definition.
This is just an example and I am sure there are many more potential uses.
I tried a few things which I won't bother showing here because they didn't work, but it seems to be only possible to create new units convertible to/from units measuring the same quantity.
Thank you, Chris.
Beta Was this translation helpful? Give feedback.
All reactions