sisl.shape.Sphere

class sisl.shape.Sphere(radius, center=None)

Bases: sisl.shape.Ellipsoid

3D Sphere

Parameters

r (float) – radius of the sphere

Methods

copy()

expand(radius)

Expand sphere by a constant radius

scale(scale)

Return a new sphere with a larger radius

set_center(center)

Change the center of the object

toCuboid()

Return a cuboid with side lengths equal to the diameter of each ellipsoid vectors

toEllipsoid()

Convert this sphere into an ellipsoid

toSphere()

Return a copy of it-self

volume()

Return the volume of the sphere

within(other, *args, **kwargs)

Return True if other is fully within self

within_index(other[, tol])

Return indices of the points that are within the shape

center

The geometric center of the shape

radius

Return the radius of the Sphere

__init__(radius, center=None)[source]
property center

The geometric center of the shape

copy()[source]
expand(radius)[source]

Expand sphere by a constant radius

Parameters

radius (float) – the extension in Ang per ellipsoid radial vector

property radius

Return the radius of the Sphere

scale(scale)[source]

Return a new sphere with a larger radius

Parameters

scale (float) – the scale parameter for the radius

set_center(center)

Change the center of the object

toCuboid()

Return a cuboid with side lengths equal to the diameter of each ellipsoid vectors

toEllipsoid()[source]

Convert this sphere into an ellipsoid

toSphere()[source]

Return a copy of it-self

volume()[source]

Return the volume of the sphere

within(other, *args, **kwargs)

Return True if other is fully within self

If other is an array, an array will be returned for each of these.

Parameters
  • other (array_like) – the array/object that is checked for containment

  • *args – passed directly to within_index

  • **kwargs – passed directly to within_index

within_index(other, tol=1e-08)

Return indices of the points that are within the shape

Parameters
  • other (array_like) – the object that is checked for containment

  • tol (float, optional) – absolute tolerance for boundaries