Sphere¶
-
class
sisl.shape.
Sphere
(radius, center=None)¶ Bases:
sisl.shape.Ellipsoid
3D Sphere
- Parameters
r (float) – radius of the sphere
Attributes
__dict__
__doc__
__module__
__slots__
__weakref__
list of weak references to the object (if defined)
_center
_iv
_v
The geometric center of the shape
Return the radius of the Sphere
Methods
__add__
(other)__and__
(other)__contains__
(other)Checks whether all of other is within the shape
__delattr__
Implement delattr(self, name).
__dir__
Default dir() implementation.
__eq__
Return self==value.
__format__
Default object formatter.
__ge__
Return self>=value.
__getattribute__
Return getattr(self, name).
__gt__
Return self>value.
__hash__
Return hash(self).
__init__
(radius[, center])Initialize self.
__init_subclass__
This method is called when a class is subclassed.
__le__
Return self<=value.
__lt__
Return self<value.
__ne__
Return self!=value.
__new__
Create and return a new object.
__or__
(other)__reduce__
Helper for pickle.
__reduce_ex__
Helper for pickle.
__repr__
Return repr(self).
__setattr__
Implement setattr(self, name, value).
__sizeof__
Size of object in memory, in bytes.
__str__
()Return str(self).
__sub__
(other)__subclasshook__
Abstract classes can override this to customize issubclass().
__xor__
(other)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
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 selfwithin_index
(other[, tol])Return indices of the points that are within the shape
-
property
center
¶ The geometric center of the shape
-
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
-
within
(other, *args, **kwargs)¶ Return
True
if other is fully within selfIf 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