Skip to content
New issue

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

Radians per second to Hertz conversion incorrect #50

Closed
sdonnan opened this issue Mar 21, 2017 · 7 comments
Closed

Radians per second to Hertz conversion incorrect #50

sdonnan opened this issue Mar 21, 2017 · 7 comments
Labels

Comments

@sdonnan
Copy link

sdonnan commented Mar 21, 2017

> 6rad/s -> hertz

    6Hz

Expected result: 0.9549Hz

@itdaniher
Copy link

Not even a sig figs issue:

> 6.01 radians / second -> hertz
6.01Hz

@itdaniher
Copy link

itdaniher commented Mar 22, 2017

units does the same thing:

You have: 6 radians per second
You want: hz
        * 6
        / 0.16666667
You have: 6 radians
You want:
        Definition: 6 radian
You have: radians
You want:
        Definition: radian = 1 radian

Radians is apparently a base unit as far as insect and units is concerned. We both expected radians as 2pi, but this could also be expressed in degrees. No idea what's technically correct - if insect did base unit decomposition as units does, it would be fairly trivial for an end user to observe that rad resolves to a base unit, rather than a constant of 2pi (tau) or a degrees angle conversion.

Also, your test case is semantically ambiguous, as 'rad' in the context of dimensional analysis is a depreciated unit of measure proportional to (radiation) energy in joules per kilogram:

You have: 1 rad
You want: 0.01 J / kg
        * 1

edit: markdown

@itdaniher
Copy link

Even more interestingly - gnu units (and insect) are technically correct here, since 1995 "radian" is a unitless "SI-derived" parameter, so the shortcut taken by insect seems to be radian = 1.

Current behavior might violate the principle of least astonishment, but this doesn't seem to be a bug per-se. Obviously, interesting observation nevertheless!

@sdonnan
Copy link
Author

sdonnan commented Mar 22, 2017

Thanks for looking into this! I agree the behavior is definitely unexpected and can be explained by your interpretation of the radian unit definition.

Here is another surprising example which is related:

> 360 degrees/sec -> Hz
  6.28319Hz

which doesn't really seem to make sense (I'd expect it to be 1Hz), but can be explained by the radian behavior.

As a user that does a lot of conversions with radians it would be more useful if the conventional radian conversions worked as expected. However, I will have to do some more digging to convince myself one way or the other is technically correct based on the unit definitions.

@sdonnan
Copy link
Author

sdonnan commented Mar 22, 2017

It seems like one would need to assume that any quantity measured in radians per second is an angular velocity in order to invoke the expected conversion (2 pi radians / s = 1 Hz). Pure dimensional analysis fails because (as you mentioned before) they technically have the same units (1/s).

So perhaps this should be a feature request for the calculator to abandon what I assume is a nice and tidy dimensional analysis approach to invoke a useful conversion in this corner case.

@sharkdp
Copy link
Owner

sharkdp commented Mar 22, 2017

I would argue that the current behavior is not only technically correct, but also the expected behavior 😄.

The confusing part is that rotations per second and angle per second (= rotational speed / angular velocity) have the same dimension (1/time), and can both be expressed in Hz. The reason is that both number of rotations and angle are dimensionless quantities.

If I am interpreting correctly, you are interested in rotations per second. If something rotates by 720° in 1s, you want the answer to be 2Hz, because it rotates twice per second (correct me if I'm wrong). On the other hand, the quantities you entered (6rad / s or 360° / s) are expressed in angle per second.

If you want rotations per second, you would have to compute the number of rotations first (720° / 360° = 2) and then divide by the time (1s):

> (720°/360°)/s -> Hz
2Hz

Same thing in radians: In your first example, you would need to compute the number of rotations (6 rad / 2pi rad = 0.95493) and then divide by 1s:

> (6 rad / 2pi rad) / s -> Hz
0.95493Hz

Even more interestingly - gnu units (and insect) are technically correct here, since 1995 "radian" is a unitless "SI-derived" parameter, so the shortcut taken by insect seems to be radian = 1.

Yes, exactly: https://en.wikipedia.org/wiki/SI_derived_unit#Derived_units_with_special_names

360° = 2π rad = 2π

@sharkdp
Copy link
Owner

sharkdp commented Mar 24, 2017

@sdonnan Can this be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants