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 to Circle(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 in Circle.
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 Circle constructor parameters.
translate(t[, fix_anchor_points]) Translate GeometricRegion points and vectors by Vector 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 in Circle.
todict() Returns a dict of the Circle constructor parameters.

Attributes Documentation

area

Circle area, \(A=\pi r^2\).

center

Center point \((h, k)\) of circle.

centroid

Alias for center.

r

Circle radius, \(r\).

Methods Documentation

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

Test region membership of point in Circle.

Parameters:point (array_like) –
Returns:True if point is within Circle, 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\]
todict()[source] [edit on github][source]

Returns a dict of the Circle constructor parameters.