Ellipsoid

class sknano.core.geometric_regions.Ellipsoid(center=None, rx=1, ry=1, rz=1)[source] [edit on github][source]

Bases: sknano.core.geometric_regions.Geometric3DRegion

Geometric3DRegion for an ellipsoid.

New in version 0.3.0.

Represents an axis-aligned ellipsoid centered at the point \((c_x, c_y, c_z)\) with semi-axes lengths \(r_x, r_y, r_z\).

Parameters:
  • center (array_like or Point) – 3-tuple of floats or an instance of the Point class specifying the center point coordinates \((x,y,z)\) of the axis-aligned Ellipsoid with semi-axes lengths rx, ry, rz.
  • ry, rz (rx,) – Semi-axes lengths \(r_x, r_y, r_z\) of axis-aligned Ellipsoid centered at center.

Notes

Ellipsoid represents the axis-aligned ellipsoid:

\[\left\{\{x, y, z\}\in R^3| \left(\frac{x-c_x}{r_x}\right)^2 + \left(\frac{y-c_y}{r_y}\right)^2 + \left(\frac{z-c_z}{r_z}\right)^2\le 1\right\}\]

Calling Ellipsoid with no parameters is equivalent to Ellipsoid(center=[0, 0, 0], rx=1, ry=1, rz=1).

Attributes

bounding_box Bounding Cuboid.
center Ellipsoid center point \((c_x, c_y, c_z)\).
centroid Alias for center.
fmtstr Format string.
measure Alias for volume, which is the measure of a 3D geometric region.
ndim Return the dimensions.
pmax Point at maximum extent.
pmin Point at minimum extent.
rx Length of semi-axis \(r_x\).
ry Length of semi-axis \(r_y\).
rz Length of semi-axis \(r_z\).
volume Ellipsoid volume, \(V=\frac{4}{3}\pi r_x r_y r_z\).

Methods

center_centroid() Center centroid on origin.
contains(point) Test region membership of point in Ellipsoid.
get_points() Return list of points from GeometricRegion.points and GeometricRegion.vectors
rotate(**kwargs) Rotate GeometricRegion points and vectors.
todict() Returns a dict of the Ellipsoid constructor parameters.
translate(t[, fix_anchor_points]) Translate GeometricRegion points and vectors by Vector t.

Attributes Summary

center Ellipsoid center point \((c_x, c_y, c_z)\).
centroid Alias for center.
rx Length of semi-axis \(r_x\).
ry Length of semi-axis \(r_y\).
rz Length of semi-axis \(r_z\).
volume Ellipsoid volume, \(V=\frac{4}{3}\pi r_x r_y r_z\).

Methods Summary

contains(point) Test region membership of point in Ellipsoid.
todict() Returns a dict of the Ellipsoid constructor parameters.

Attributes Documentation

center

Ellipsoid center point \((c_x, c_y, c_z)\).

centroid

Alias for center.

rx

Length of semi-axis \(r_x\).

ry

Length of semi-axis \(r_y\).

rz

Length of semi-axis \(r_z\).

volume

Ellipsoid volume, \(V=\frac{4}{3}\pi r_x r_y r_z\).

Methods Documentation

contains(point)[source] [edit on github][source]

Test region membership of point in Ellipsoid.

Parameters:point (array_like) –
Returns:True if point is within Ellipsoid, False otherwise
Return type:bool

Notes

A point \((p_x, p_y, p_z)\) is within the bounded region of an ellipsoid with center \((c_x, c_y, c_z)\) and semi-axes lengths \(r_x, r_y, r_z\) if the following is true:

\[\left(\frac{p_x - c_x}{r_x}\right)^2 + \left(\frac{p_y - c_y}{r_y}\right)^2 + \left(\frac{p_z - c_z}{r_z}\right)^2\le 1\]
todict()[source] [edit on github][source]

Returns a dict of the Ellipsoid constructor parameters.