goldfirere / units

The home of the units Haskell package
94 stars 19 forks source link

Dimension for "Hertz" #68

Open jameysharp opened 9 years ago

jameysharp commented 9 years ago

The unit of "Hertz" is usually written 1/s, but I'm not sure that's what people really mean. I think Hertz is more usefully defined as cycles/second, where 1 cycle is 360 degrees, 2pi radians, 2 semi-circles, etc. So I think the right dimension for Hertz is angle/time. Is that sensible and consistent with common usage?

goldfirere commented 9 years ago

In my experience, Hertz is most usefully defined as (s^-1). The problem is that I've seen Hertz used to describe occurrences/second, even when no angle is involved. And, if we did have "angle" in the numerator, we'd need an Angle dimension, which I haven't seen before.

I do think there's something interesting to be said here, but I'd want to see something fully worked out before implementing it here...

nushio3 commented 9 years ago

I can complement this article from a standpoint of a computational astronomer.

First, since units is an open system, we are free to add the new dimension Angle and units for it as a separate library. Since there is a controversy over whether angle is a standalone dimension or non-dimensional quantity, a separate library is a good solution that satisfy the both party.

In radio astronomy we have to distinguish between quantities, quantities per angles, quantities per solid angles. The purpose of quantity calculus is to help people make such distinction. So I am Angle-is-a-dimension-ist, and am eager to write such a library.

Second, Hz is also the units for CPU frequency and beats of a heart, which are cyclic but not rotational phenomena. Therefore I prefer to consider Hertz just generically as s^{-1}. Probably it is also a cycle per second , but not 360 degrees per second.

jameysharp commented 9 years ago

I'm not sure this needs a separate package. I think introducing an Angle dimension in units-defs is sufficient. (And a "solid angle" dimension? I don't know what that means.) I'm fine with leaving Hertz defined as it is.

Given that, I think the canonical unit of angle is one Circle or Cycle, and semicircles/radians/degrees are all derived as fractions thereof.

The remaining question in my mind is what to name the module with these new units and dimensions. I guess SI doesn't cover them? They certainly aren't US specific either. Perhaps Data.Dimension.Angle and Data.Units.Angle?

goldfirere commented 9 years ago

Since you practitioners want it, I'm happy to have Angle and such in units-defs. I like Data.Dimensions.Angle and Data.Units.Angle, myself, but I'm also happy to leave it to you to figure out the details.

goldfirere commented 9 years ago

Just noting I'm delegating this ticket out to contributors. @jameysharp and @nushio3 -- I'm very happy with this idea, but I think you as practitioners will make for a better design than I will.

FranklinChen commented 6 years ago

Discussion of a related question, on properly distinguishing Hertz and Becquerel: https://github.com/bjornbm/dimensional/issues/188#issuecomment-391555350