Ellipse

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

Bases: sknano.core.geometric_regions.Geometric2DRegion

Geometric2DRegion for an ellipse.

New in version 0.3.0.

Represents an axis-aligned ellipse centered at \((c_x, c_y)\) with semi-axes lengths \(r_x, r_y\).

Parameters:
  • center (array_like, optional) – Center of axis-aligned ellipse with semi-axes lengths \(r_x, r_y\)
  • ry (rx,) – Lengths of semi-axes \(r_x, r_y\)

Notes

Ellipse 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 Ellipse with no parameters is equivalent to Ellipse(center=[0, 0], rx=1, ry=1).

Attributes

area Ellipse area, \(A=\pi r_x r_y\).
bounding_box Bounding Cuboid.
center Ellipse center point \((c_x, c_y)\).
centroid Alias for center.
fmtstr Format string.
measure Alias for area, which is the measure of a 2D 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\).

Methods

center_centroid() Center centroid on origin.
contains(point) Test region membership of point in Ellipse.
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 Ellipse constructor parameters.
translate(t[, fix_anchor_points]) Translate GeometricRegion points and vectors by Vector t.

Attributes Summary

area Ellipse area, \(A=\pi r_x r_y\).
center Ellipse center point \((c_x, c_y)\).
centroid Alias for center.
rx Length of semi-axis \(r_x\).
ry Length of semi-axis \(r_y\).

Methods Summary

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

Attributes Documentation

area

Ellipse area, \(A=\pi r_x r_y\).

center

Ellipse center point \((c_x, c_y)\).

centroid

Alias for center.

rx

Length of semi-axis \(r_x\).

ry

Length of semi-axis \(r_y\).

Methods Documentation

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

Test region membership of point in Ellipse.

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

Notes

A point \((p_x, p_y)\) is within the bounded region of an ellipse with center \((c_x, c_y)\) and semi-axes lengths \(r_x, r_y\) 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\le 1\]
todict()[source] [edit on github][source]

Returns a dict of the Ellipse constructor parameters.