Shapes.Ellipsoid#

Shapes.Ellipsoid.py

class Ellipsoid(a, b, c, center=None)#

Bases: object

Sphere class to represent a spherical density space.

a#

The semi-axis length along the x-axis.

Type:

float

b#

The semi-axis length along the y-axis.

Type:

float

c#

The semi-axis length along the z-axis.

Type:

float

center#

The center of the ellipsoid. If None, the center is assumed to be at the center of the grid when used in get_condition.

Type:

tuple of float, optional

Initialize the Ellipsoid object. :param a: The semi-axis length along the x-axis. :type a: float :param b: The semi-axis length along the y-axis. :type b: float :param c: The semi-axis length along the z-axis. :type c: float :param center: The center of the ellipsoid. If None, the center is assumed to be at the

center of the grid when used in get_condition.

get_condition(xx, yy, zz, center=None)#

Get the condition for the ellipsoid.

Parameters:
  • xx (np.ndarray) – The x-coordinates grid.

  • yy (np.ndarray) – The y-coordinates grid.

  • zz (np.ndarray) – The z-coordinates grid.

  • center (tuple of float, optional) – The center of the ellipsoid. If None, the center attribute of the object is used. If the center attribute is also None, the center is assumed to be at the center of the grid.

Returns:

A boolean array where True indicates points inside the ellipsoid.

Return type:

np.ndarray

get_rg()#

Calculate the radius of gyration of the ellipsoid.

Returns:

The radius of gyration of the ellipsoid.

Return type:

float

get_volume()#

Calculate the volume of the ellipsoid.

Returns:

The volume of the ellipsoid.

Return type:

float