Shapes.Sphere#
Shapes.Sphere.py
- class Sphere(radius, center=None)#
Bases:
objectSphere class to represent a spherical density space.
- center#
The center of the sphere. If None, the center is assumed to be at the center of the grid when used in get_condition.
Initialize the Sphere object.
- Parameters:
- get_condition(xx, yy, zz, center=None)#
Get the condition for the sphere.
- 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 sphere. 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 points inside the sphere are True.
- Return type:
np.ndarray
- get_rg()#
Calculate the radius of gyration of the sphere.
- Returns:
The radius of gyration of the sphere.
- Return type: