Closed Papakura closed 6 years ago
You hit an annoying pain point with the library. For better dimensional analysis, the library treats radians as a dimension, but meters/meters
winds up as a dimensionless unit. There's no way to really figure that out using only the type system, because the two would have the same type but different meanings. There's also context to consider: not every meter/meter
quantity represents a radian.
If possible, the best thing to do is create a radian type from your meter/meter
type before hand (using a cast), and then the conversions and dimensional analysis should work as expected. The overloads, for your context, don't seem that bad to me, although probably a bit more difficult to implement.
Hi,
I'm attempting to calculate angular velocity where
w (rad/s) = s (meters/s) / r (meters)
but the types are not compatible.
so ended up creating operator overloads for
s (meters/s) / r (meters) - (/ operator)
and
*w (rad/s) r (meters)* - ( operator)
I wanted to check if there was a more optimal way of doing this?