============ Hydrostatics ============ Capytaine can compute hydrostatic parameters of a given :code:`FloatingBody` or :code:`Multibody`. Some of them may require the definition of the center of mass of the body. It can be done by setting the ``center_of_mass`` at body initialization as in the example below:: import capytaine as cpt import numpy as np rigid_sphere = cpt.FloatingBody( mesh=cpt.mesh_sphere(radius=1.0, center=(0, 0, 0)), dofs=cpt.rigid_body_dofs(rotation_center=(0, 0, -0.2)), center_of_mass=(0, 0, -0.4), name="sphere" # optional ) The hydrostatic parameters can be computed and stored in an ``xarray.Dataset`` with the :func:`~capytaine.compute_hydrostatics_dataset` function:: hs_dataset = cpt.compute_hydrostatics_dataset(rigid_sphere, rho=1025) # Size: 956B # Dimensions: (space_coordinate: 3, influenced_dof: 6, # radiating_dof: 6) # Coordinates: # * space_coordinate (space_coordinate)