circles#
Shapes that are circular in nature.
Classes
|
Class representing a bullseye shape comprising two concentric circles. |
|
Class representing a hollow circle. |
- class data_morph.shapes.circles.Bullseye(dataset: Dataset)[source]#
Bases:
ShapeClass representing a bullseye shape comprising two concentric circles.
This shape is generated using the panda dataset.#
- Parameters:
dataset (Dataset) – The starting dataset to morph into other shapes.
- circles: list[data_morph.shapes.circles.Circle]#
The inner and outer
Circleobjects.
- distance(x: Number, y: Number) float[source]#
Calculate the minimum absolute distance between this bullseye’s inner and outer circles’ edges and a point (x, y).
- Parameters:
x (numbers.Number) – Coordinates of a point in 2D space.
y (numbers.Number) – Coordinates of a point in 2D space.
- Returns:
The minimum absolute distance between this bullseye’s inner and outer circles’ edges and the point (x, y).
- Return type:
See also
Circle.distanceA bullseye consists of two circles, so we use the minimum distance to one of the circles.
- class data_morph.shapes.circles.Circle(dataset: Dataset, r: Number | None = None)[source]#
Bases:
ShapeClass representing a hollow circle.
This shape is generated using the panda dataset.#
- Parameters:
dataset (Dataset) – The starting dataset to morph into other shapes.
r (numbers.Number, optional) – The radius of the circle.
- distance(x: Number, y: Number) float[source]#
Calculate the absolute distance between this circle’s edge and a point (x, y).
- Parameters:
x (numbers.Number) – Coordinates of a point in 2D space.
y (numbers.Number) – Coordinates of a point in 2D space.
- Returns:
The absolute distance between this circle’s edge and the point (x, y).
- Return type:
- plot(ax: Axes = None) Axes[source]#
Plot the shape.
- Parameters:
ax (matplotlib.axes.Axes, optional) – An optional
Axesobject to plot on.- Returns:
The
Axesobject containing the plot.- Return type: