graphinglib.Circle#
- class graphinglib.Circle(x_center: float, y_center: float, radius: float, fill: bool = 'default', fill_color: str = 'default', edge_color: str = 'default', line_width: float | Literal['default'] = 'default', line_style: str = 'default', fill_alpha: float | Literal['default'] = 'default', number_of_points: int = 100)[source]#
This class implements a Circle object with a given center and radius.
- Parameters:
- x_centerfloat
The x coordinate of the
Circle.- y_centerfloat
The y coordinate of the
Circle.- radiusfloat
The radius of the
Circle.- fillbool, optional
Whether the circle should be filled or not. Default depends on the
figure_styleconfiguration.- fill_colorstr, optional
The color of the circle’s fill. Default depends on the
figure_styleconfiguration.- edge_colorstr, optional
The color of the circle’s edge. Default depends on the
figure_styleconfiguration.- line_widthfloat, optional
The width of the line. Default depends on the
figure_styleconfiguration.- line_stylestr, optional
The style of the line. Default depends on the
figure_styleconfiguration.- fill_alphafloat, optional
The alpha value of the fill. Default depends on the
figure_styleconfiguration.- number_of_pointsint, optional
The number of points to use to approximate the circle. Default is 100 (covers approximately 99.9% of perfect circle area).
Methods
__init__(x_center, y_center, radius[, fill, ...])copy()Returns a deep copy of the
Polygonobject.Returns the center point of the polygon.
create_difference(other[, copy_style])Returns the difference of the polygon with another polygon.
create_intersection(other[, copy_style])Returns the intersection of the polygon with another polygon.
create_intersection_points(other)Returns the intersection points of the borders of the two polygons.
create_symmetric_difference(other[, copy_style])Returns the symmetric difference of the polygon with another polygon.
create_union(other[, copy_style])Returns the union of the polygon with another polygon.
Returns the center coordinates of the polygon.
get_intersection_coordinates(other)Returns the coordinates of the intersection points of the borders of the two polygons.
linear_transformation(matrix)Applies a transformation matrix to the polygon.
rotate(angle[, center, use_rad])Rotates the polygon by the specified angle.
scale(x_scale, y_scale[, center])Scales the polygon by the specified factors.
skew(x_skew, y_skew[, center, use_rad])Skews the polygon by the specified factors.
split(curve[, copy_style])Splits the polygon by a curve.
translate(dx, dy)Translates the polygon by the specified amount.