java - Java 程序的重心类

标签 java math

我可能必须实现一个重心类,但在此之前我会寻求帮助来寻找这样的 Java 类。我怀疑这已经被其他人作为数学库的一部分实现了。

在 n 维空间中,假设每个维度都是离散的。例如,在 3 维中,您可以拥有范围为 [0..a] 的 X 维度。您还有一个范围为 [0..b] 的 Y 维度和一个范围为 [0..c] 的 Z 维度。实现应该是通用的,以便维数可以大于 3,并且通常 a 不等于 b,其中 ab 是它们各自维度的最大坐标。

空间中的每个点都是 double float (非负)。

求重心坐标。

最佳答案

如果你使用物理引擎,你可以轻松获得重心——试试JBullet :) 您可以使用 API 获得的质心本质上是相同的,但略有不同:

The term center of mass is often used interchangeably with center of gravity, but they are physically different concepts. They happen to coincide in a uniform gravitational field, but where gravity is not uniform, center of gravity refers to the mean location of the gravitational force acting on a body. This results in small but measurable gravitational torque that must be accounted for in the operation of artificial satellites.

http://www.continuousphysics.com/Bullet/BulletFull/classbtRigidBody.html

关于java - Java 程序的重心类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6970229/

相关文章:

javascript - 如何通过算法为表格对 Angular 线的对 Angular 线着色

.net - 在 .NET 中模拟 VBA 算法

java - 通过js调用访问小程序中的智能卡 keystore

java - 玩2.3.x框架: How to decline all non application/json requests

java - XX 的默认值 :MaxDirectMemorySize

java - 从 eclipse 插件项目运行 program.exe

javascript - 用户输入最小值和最大值的数学随机

java spring mvc json databind 自定义 json 响应

algorithm - 特定类型模式分析的最佳神经网络?

python - Python 中的 C 指针算法