We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is this the intended behaviour when converting units involving angles?
julia> ω = 1u"rad*s^-1" 1 rad s^-1 julia> uconvert(u"s^-1", ω) 1 s^-1
I believe the correct result should be 1/2π s^-1. If the conversion is not intended, perhaps a DimensionError should be thrown instead?
1/2π s^-1
DimensionError
The text was updated successfully, but these errors were encountered:
This occurs because radians are defined in pkgdefaults.jl as dimensionless and numerically equal to 1:
pkgdefaults.jl
Unitful.jl/src/pkgdefaults.jl
Line 66 in b44c335
If you want revolutions per second, you can instead convert to rps:
rps
julia> ω = 1u"rad/s" 1 rad s⁻¹ julia> uconvert(u"rps", ω) 0.15915494309189535 rps
Alternatively, converting to Hz2π will get you the same numerical result.
Hz2π
julia> uconvert(u"Hz2π", ω) 0.15915494309189535 Hz2π
Sorry, something went wrong.
Ah ok, that makes sense, thanks!
@jamesgardner1421 checkout DimensionfulAngles.jl and in particular this Equivalence.
No branches or pull requests
Is this the intended behaviour when converting units involving angles?
I believe the correct result should be
1/2π s^-1
. If the conversion is not intended, perhaps aDimensionError
should be thrown instead?The text was updated successfully, but these errors were encountered: