So, after writing the Angles.jl package, and getting excited about it, I think I finally understand why it’s not such a great idea. But I would love to hear your opinions and thought about it.
The main reason not to have such a package is that it is unclear when an angle stops being an angle (apart from when you’ve run, for example,
sin on it). Currently, the user needs to specifically extract the value out of the
Angle subtype to stop it from being an angle.
There are two other ways to approach this (I think):
- Just use
Unitful.jl. Angles exist there within the context of units: they might get canceled out, they might propagate through the whole calculation as intended, or you can purposefully strip off the unit and get their value.
- Have angles magically act exactly like any subtype of
Number. You’d never need to even care if they stopped being an angle or not.
Since option #2 is not practical now (and might not even be in the future), it seems to me that I should instead add more “angular things” to
Unitful.jl (if even needed), rather than hold this one unit separate from the others.
What do you think?