# Overriding Center of Gravity/Moment of Inertia

**URL:** <https://gpusph.discourse.group/t/overriding-center-of-gravity-moment-of-inertia/197>\
**Category:** Uncategorized\
**Created:** [February 15, 2024, 11:11pm UTC](https://gpusph.discourse.group/t/overriding-center-of-gravity-moment-of-inertia/197 "2024-02-15T23:11:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ethan\_Evans](https://yyz2.discourse-cdn.com/free1/user_avatar/gpusph.discourse.group/ethan_evans/32/141_2.png) [@Ethan\_Evans](https://gpusph.discourse.group/u/Ethan_Evans)\
**Post date:** [February 15, 2024, 11:11pm UTC](https://gpusph.discourse.group/t/overriding-center-of-gravity-moment-of-inertia/197/1 "2024-02-15T23:11:27Z")

</div>

I am looking to create an object which will then be handled by project chrono. In order to maintain stability in a certain orientation, I would like the center the center of mass below the center of buoyancy. Is it possible to gain manual control over the center of mass and moment of inertia quantities for a created GeometryID?

Appreciate any help!

---

<div class="post-metadata">

**Author:** ![giuseppe.bilotta](https://yyz2.discourse-cdn.com/free1/user_avatar/gpusph.discourse.group/giuseppe.bilotta/32/72_2.png) [@giuseppe.bilotta](https://gpusph.discourse.group/u/giuseppe.bilotta)\
**Post date:** [February 16, 2024, 6:18am UTC](https://gpusph.discourse.group/t/overriding-center-of-gravity-moment-of-inertia/197/2 "2024-02-16T06:18:56Z")

</div>

Hello @Ethan_Evans, welcome to GPUSPH!

the methods you’re looking for are `setCenterOfGravity()` and `setInertia()`.

`setCenterOfGravity` takes as parameters the `GeometryID` returned by `add`_Whatever_, and the coordinates of the center of gravity in the global reference system, either as 3 floating-point values or as a `Point` object.

`setInteria` takes as parameters the `GeometryID` and three floating-point values for the inertia components along the principal axes of inertia.

The orientation of the principal axes of inertia usually follows the object rotation, but can be overridden using `setOrientation`, that takes as parameters the `GeometryID` and an `EulerParameter` object describing the orientation.
