Ellipsoid¶
-
class
sisl.shape.Ellipsoid(v, center=None)[source]¶ 3D Ellipsoid shape
- Parameters
- vfloat or (3,) or (3, 3)
radius/vectors defining the ellipsoid. For 3 values it corresponds to a Cartesian oriented ellipsoid. If the vectors are non-orthogonal they will be orthogonalized. I.e. the first vector is considered a principal axis, then the second vector will be orthogonalized onto the first, and this is the second principal axis. And so on.
- center(3,), optional
the center of the ellipsoid. Defaults to the origo.
Examples
>>> shape = Ellipsoid([2, 2.2, 2]) >>> shape.within([0, 2, 0]) True
Attributes
The geometric center of the shape
Return the radius of the Ellipsoid
Methods
__init__(self, v[, center])Initialize self.
copy(self)expand(self, radius)Expand ellipsoid by a constant value along each radial vector
scale(self, scale)Return a new shape with a larger corresponding to
scaleset_center(self, center)Change the center of the object
toCuboid(self)Return a cuboid with side lengths equal to the diameter of each ellipsoid vectors
toEllipsoid(self)Return an ellipsoid that encompass this shape (a copy)
toSphere(self)Return a sphere with a radius equal to the largest radial vector
volume(self)Return the volume of the shape
within(self, other)Return
Trueif other is fully within selfwithin_index(self, other)Return indices of the points that are within the shape
-
property
center¶ The geometric center of the shape
-
expand(self, radius)[source]¶ Expand ellipsoid by a constant value along each radial vector
- Parameters
- radiusfloat or (3,)
the extension in Ang per ellipsoid radial vector
-
property
radius¶ Return the radius of the Ellipsoid
-
scale(self, scale)[source]¶ Return a new shape with a larger corresponding to
scale- Parameters
- scalefloat or (3,)
the scale parameter for each of the vectors defining the
Ellipsoid
-
toCuboid(self)[source]¶ Return a cuboid with side lengths equal to the diameter of each ellipsoid vectors
-
within(self, other)¶ Return
Trueif other is fully within selfIf other is an array, an array will be returned for each of these.
- Parameters
- otherarray_like
the array/object that is checked for containment