You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect conversion to/from rad/s or deg/s and hertz #188
The conversion between hertz and rad/s or deg/s does not produce the expected results.
Example 1: 360 deg/s gets converted to 2pi Hertz
Example 2: 2pi rad/s gets converted to 2*pi Hertz
The expected result for both of these conversions is 1 Hertz (https://en.wikipedia.org/wiki/Radian_per_second). I would expect the quantities package to either produce 1 Hertz or to throw an error due to incompatible units.
I suspect this is because radians are dimensionless and so they can convert from rad/s (dimensionless/sec quantity) to hertz (1/sec quantity).
The core of the issue is that "Hertz" as a unit is defined as 1 cycle per second, but is commonly used for angular velocity with 1 cycle = 2*pi radians implied.
I'm not sure of the right way to fix this but one option would be to define a new quantity of "angularHertz" defined as 2*pi rad/s, and throw an error if the plain-old hertz is converted to/from an angular velocity.
Activity
twmr commentedon Aug 15, 2021
@mcdowns1 Have you checked how other quantity packages (astropy.units, pint, unyt, ...) handle this?
apdavison commentedon Jan 13, 2022
also see #174