[ANN] DimensionfulAngles.jl: An extension of Unitful.jl to include angles as a dimension

I wrote a package to include angles as a dimension when using Unitful.jl. It allows for dispatching on Angle quantities.

Angles not having a dimension has been the cause of many issues:
#570 #531 #537 #392 #216 #38.

The basic usage is as follows:

julia> using Unitful

julia> using DimensionfulAngles

julia> dimensionless_angle = 1u"rad"

1 rad

julia> dimensionful_angle = 1u"radแตƒ"
1 rad

julia> typeof(dimensionless_angle)
Quantity{Int64, NoDims, Unitful.FreeUnits{(rad,), NoDims, nothing}}

julia> typeof(dimensionful_angle)
Quantity{Int64, ๐€, Unitful.FreeUnits{(rad,), ๐€, nothing}}

You can then dispatch functions on angle quantities. One example included in the package is an Equivalence using UnitfulEquivalences.jl that converts between period, frequency, and angular frequency:

f = \frac{1}{T}=\frac{ฯ‰}{2ฯ€}

julia> using Unitful

julia> using DimensionfulAngles

julia> uconvert(u"s", 10u"Hz", Periodic())
0.1 s

julia> uconvert(u"radแตƒ/s", 1u"Hz", Periodic())
6.283185307179586 rad sโปยน

I hope some find it useful!

It is also my first Julia package which I used to try to learn all aspects of package creation (testing, documentation, registering, etc.). And I am still very new to Julia. So I could use feedback on any aspect of the project! :nerd_face:

6 Likes