Ellipse¶
-
class
sknano.core.geometric_regions.Ellipse(center=None, rx=1, ry=1)[source] [edit on github][source]¶ Bases:
sknano.core.geometric_regions.Geometric2DRegionGeometric2DRegionfor an ellipse.New in version 0.3.0.
Represents an axis-aligned ellipse centered at (cx,cy) with semi-axes lengths rx,ry.
Parameters: - center (array_like, optional) – Center of axis-aligned ellipse with semi-axes lengths rx,ry
- ry (rx,) – Lengths of semi-axes rx,ry
Notes
Ellipserepresents the axis-aligned ellipsoid:{{x,y,z}∈R3|(x−cxrx)2+(y−cyry)2+(z−czrz)2≤1}Calling
Ellipsewith no parameters is equivalent toEllipse(center=[0, 0], rx=1, ry=1).Attributes
areaEllipsearea, A=πrxry.bounding_boxBounding Cuboid.centerEllipsecenter point (cx,cy).centroidAlias for center.fmtstrFormat string. measureAlias for area, which is the measure of a 2D geometric region.ndimReturn the dimensions. pmaxPointat maximum extent.pminPointat minimum extent.rxLength of semi-axis rx. ryLength of semi-axis ry. Methods
center_centroid()Center centroidon origin.contains(point)Test region membership of pointinEllipse.get_points()Return list of points from GeometricRegion.pointsandGeometricRegion.vectorsrotate(**kwargs)Rotate GeometricRegionpointsandvectors.todict()Returns a dictof theEllipseconstructor parameters.translate(t[, fix_anchor_points])Translate GeometricRegionpointsandvectorsbyVectort.Attributes Summary
areaEllipsearea, A=πrxry.centerEllipsecenter point (cx,cy).centroidAlias for center.rxLength of semi-axis rx. ryLength of semi-axis ry. Methods Summary
contains(point)Test region membership of pointinEllipse.todict()Returns a dictof theEllipseconstructor parameters.Attributes Documentation
-
rx¶ Length of semi-axis rx.
-
ry¶ Length of semi-axis ry.
Methods Documentation
-
contains(point)[source] [edit on github][source]¶ Test region membership of
pointinEllipse.Parameters: point (array_like) – Returns: Trueifpointis withinEllipse,FalseotherwiseReturn type: boolNotes
A
point(px,py) is within the bounded region of an ellipse with center (cx,cy) and semi-axes lengths rx,ry if the following is true:(px−cxrx)2+(py−cyry)2≤1