SciNim / Unchained

A fully type safe, compile time only units library.
https://scinim.github.io/Unchained
109 stars 0 forks source link

Fix unit ordering and radian / steradian computations #14

Closed Vindaar closed 3 years ago

Vindaar commented 3 years ago

Fixes the issues with radians encountered in https://github.com/SciNim/getting-started/pull/30/.

It is fixed by first of all correcting the ordering of units. Higher powers are considered lower precedence, as they should appear before lower powers (to keep fractional logic).

Then makes radian and steradian distinct meter based units to avoid conversions in simple additive maths.