Circle¶
-
class
sknano.core.geometric_regions.
Circle
(center=None, r=1.0)[source] [edit on github][source]¶ Bases:
sknano.core.geometric_regions.Geometric2DRegion
Geometric2DRegion
for 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
Circle
with no parameters is equivalent toCircle
(center=[0, 0], r=1.0)
.Attributes
area
Circle
area, \(A=\pi r^2\).bounding_box
Bounding Cuboid
.center
Center point \((h, k)\) of circle. 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.r
Circle
radius, \(r\).Methods
center_centroid
()Center centroid
on origin.contains
(point)Test region membership of point
inCircle
.get_points
()Return list of points from GeometricRegion.points
andGeometricRegion.vectors
rotate
(**kwargs)Rotate GeometricRegion
points
andvectors
.todict
()Returns a dict
of theCircle
constructor parameters.translate
(t[, fix_anchor_points])Translate GeometricRegion
points
andvectors
byVector
t
.Attributes Summary
area
Circle
area, \(A=\pi r^2\).center
Center point \((h, k)\) of circle. centroid
Alias for center
.r
Circle
radius, \(r\).Methods Summary
contains
(point)Test region membership of point
inCircle
.todict
()Returns a dict
of theCircle
constructor parameters.Attributes Documentation
-
center
¶ Center point \((h, k)\) of circle.
Methods Documentation
-
contains
(point)[source] [edit on github][source]¶ Test region membership of
point
inCircle
.Parameters: point (array_like) – Returns: True
ifpoint
is withinCircle
,False
otherwise.Return type: bool
Notes
A
point
\((p_x, p_y)\) is within the bounded region of a circle with center \((h, k)\) and radius \(r\) if the following is true:\[(p_x - h)^2 + (p_y - k)^2 \le r^2\]