sisl.shape.Ellipsoid

class sisl.shape.Ellipsoid(v, center=None)

Bases: sisl.shape.PureShape

3D Ellipsoid shape

Parameters
  • v (float 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

Methods

copy()

expand(radius)

Expand ellipsoid by a constant value along each radial vector

scale(scale)

Return a new shape with a larger corresponding to scale

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()

Return an ellipsoid that encompass this shape (a copy)

toSphere()

Return a sphere with a radius equal to the largest radial vector

volume()

Return the volume of the shape

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 Ellipsoid

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

The geometric center of the shape

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

Expand ellipsoid by a constant value along each radial vector

Parameters

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

property radius

Return the radius of the Ellipsoid

scale(scale)[source]

Return a new shape with a larger corresponding to scale

Parameters

scale (float or (3,)) – the scale parameter for each of the vectors defining the Ellipsoid

set_center(center)[source]

Change the center of the object

toCuboid()[source]

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

toEllipsoid()[source]

Return an ellipsoid that encompass this shape (a copy)

toSphere()[source]

Return a sphere with a radius equal to the largest radial vector

volume()[source]

Return the volume of the shape

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)[source]

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