jScience 中的单位; angular 速度的单位是什么?

Units in jScience; Whats the unit of an angular velocity?

在我制作的应用程序中,我需要一些物理计算(功率、力、扭矩等)。我想使用 JScience,因为它在跟踪单位方面似乎非常有用。例如,要分配一个速度,我会这样做:

Amount<Velocity> vel = Amount.valueOf(100, SI.METERS_PER_SECOND);

我的问题是我想在 class 中分配一些 angular velocity,但我无法理解我的状态应该这样做。假设我想指定一个 angular 速度为 100 rad/s.

Amount<AngularVelocity> angVel = Amount.valueOf(100, {SOME UNIT});

我在 JScience 中找不到任何用于 angular 速度的单位。文档说 "The system unit for this quantity is "rad/s"(每秒弧度)。",但没有 "SI.RAD_PER_SECOND" 之类的东西或我认为的任何枚举值...

所以问题是:我在后面的代码示例中写成 {SOME UNIT} 是什么?

Birger 的欢呼声

---编辑--

得到了使用 "SI.RADIAN.divide(SI.SECOND)" 作为单位的建议,但我必须将变量分配给不同的类型。

// This will not compile, due to type mismatch
Amount<AngularVelocity> angVel = Amount.valueOf(100, SI.RADIAN.divide(SI.SECOND));

// This will compile, but I want to assign the amount as a AngularVelocity ...
Amount<?> angVel = Amount.valueOf(100, SI.RADIAN.divide(SI.SECOND));

// Another, working alternative. But, surely, there is a way to assign an angular velocity using rad/s ... ?
Amount<Frequency> angVel = Amount.valueOf(100 * Math.PI, SI.HERTZ);

我不是这个特定库的专家,但是 eclipse 中的一些快速测试让我想到了这个:

Amount<AngularVelocity> angVel = Amount.valueOf(100, AngularVelocity.UNIT);

问题在于,如果 AngularVelocity.UNIT 发生变化,您的数量也会发生变化。但我认为这不太可能。

否则,给出一行不太漂亮的代码:

Amount<AngularVelocity> angVel = Amount.valueOf(100, SI.RADIAN.divide(SI.SECOND).asType(AngularVelocity.class));

这让我在 Java 中编程时得到一个很好的提示:使用 control-space。很多。我从未使用过这个库,我仍然可以通过快速检查 AngularVelocity.UNIT 版本的文档找到它。另一种就是自己解后control-space