Circle¶
-
class
sknano.core.geometric_regions.Circle(center=None, r=1.0)[source] [edit on github][source]¶ Bases:
sknano.core.geometric_regions.Geometric2DRegionGeometric2DRegionfor a circle.New in version 0.3.0.
Represents the bounded region with center (h,k) and radius r.
Parameters: - center (array_like, optional) – Center point (h,k) of circle.
- r (float, optional) – Radius r of circle.
Notes
Calling
Circlewith no parameters is equivalent toCircle(center=[0, 0], r=1.0).Attributes
areaCirclearea, A=πr2.bounding_boxBounding Cuboid.centerCenter point (h,k) of circle. 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.rCircleradius, r.Methods
center_centroid()Center centroidon origin.contains(point)Test region membership of pointinCircle.get_points()Return list of points from GeometricRegion.pointsandGeometricRegion.vectorsrotate(**kwargs)Rotate GeometricRegionpointsandvectors.todict()Returns a dictof theCircleconstructor parameters.translate(t[, fix_anchor_points])Translate GeometricRegionpointsandvectorsbyVectort.Attributes Summary
areaCirclearea, A=πr2.centerCenter point (h,k) of circle. centroidAlias for center.rCircleradius, r.Methods Summary
contains(point)Test region membership of pointinCircle.todict()Returns a dictof theCircleconstructor parameters.Attributes Documentation
-
center¶ Center point (h,k) of circle.
Methods Documentation
-
contains(point)[source] [edit on github][source]¶ Test region membership of
pointinCircle.Parameters: point (array_like) – Returns: Trueifpointis withinCircle,Falseotherwise.Return type: boolNotes
A
point(px,py) is within the bounded region of a circle with center (h,k) and radius r if the following is true:(px−h)2+(py−k)2≤r2