diff --git a/Project.toml b/Project.toml index c0e3734..2a30e23 100644 --- a/Project.toml +++ b/Project.toml @@ -5,9 +5,11 @@ version = "0.2.0" [deps] Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d" +UnitfulAngles = "6fb2a4bd-7999-5318-a3b2-8ad61056cd98" UnitfulEquivalences = "da9c4bc3-91c8-4f02-8a40-6b990d2a7e0c" [compat] Unitful = "1.10" +UnitfulAngles = "0.7" UnitfulEquivalences = "0.2" julia = "1.7" diff --git a/README.md b/README.md index 33942a3..3381330 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ Michelén Ströfer, C. A. (2022). DimensionfulAngles.jl (Version 0.1.0) [Compute Use *DimensionfulAngles.jl* for units containing angles and *Unitful.jl* for all other units. The units in *DimensionfulAngles.jl* are differentiated from their dimensionless counterparts with a superscript `ᵃ`. -Simply add this superscript to any angle units to make it dimensionful. +Simply add this superscript to any angle units to make it dimensionful. In Julia environments this can be typed as `\^a`. ```julia @@ -125,8 +125,30 @@ julia> using DimensionfulAngles.DefaultSymbols julia> angular_velocity = 1.2rad / s ``` +### Converting to/from `Unitful.jl` +To convert a quantity to or from `Unitful.jl` use the `uconvert` function with first +argument either `:Unitful` or `:DimensionfulAngles`. +For example: + +```julia +julia> using Unitful, DimensionfulAngles + +julia> ω = 3.2u"radᵃ/s" +3.2 rad s⁻¹ + +julia> ω̄ = uconvert(:Unitful, ω) +3.2 rad s⁻¹ + +julia> dimension(ω) +𝐀 𝐓⁻¹ + +julia> dimension(ω̄) +𝐓⁻¹ +``` + + ## Contributing -