gentooboontoo / js-quantities

JavaScript library for quantity calculation and unit conversion
http://gentooboontoo.github.io/js-quantities/
MIT License
395 stars 102 forks source link

Dividing by temperatures #113

Open deisner opened 3 years ago

deisner commented 3 years ago

In some cases it is necessary to 'divide with temperatures'. For example, the SI unit for thermal conductivity is watts per meter-kelvin, i.e. W/(m*K). But I get an exception when I try to construct such a quantity:

> Qty(0.2, 'W m^-1 temp-K^-1')
Uncaught Error: Cannot divide with temperatures

Is there a way to represent such a quantity?

rage-shadowman commented 3 years ago

There are 2 separate temperature references. One is absolute temperature (ex: "tempK") which you cannot divide with. The other is relative degrees (ex: "degK") which you should be able to divide with.