Center of mass functions.
More...
|
file | mass.h |
| API header file for center of mass in zscilib.
|
|
Center of mass functions.
◆ zsl_phy_mass_center()
Calculates the three coordinate position of the center of mass of a set of objects given their masses and positions.
- Parameters
-
m | Vector that contains the mass of each object in kilograms. |
x | Vector that contains the x coordinate of each object in meters. |
y | Vector that contains the y coordinate of each object in meters. |
z | Vector that contains the z coordinate of each object in meters. |
mx | Pointer to the x position of the center of mass in meters. |
my | Pointer to the y position of the center of mass in meters. |
mz | Pointer to the z position of the center of mass in meters. |
- Returns
- 0 if everything executed properly, -EINVAL if any of the masses has a negative value or the total mass is zero.