point_collection#
Base class for shapes that are composed of points.
Classes
|
Class representing a shape formed by a collection of points. |
- class data_morph.shapes.bases.point_collection.PointCollection(*points: Iterable[Number])[source]#
Bases:
ShapeClass representing a shape formed by a collection of points.
- Parameters:
*points (Iterable[numbers.Number]) – An iterable of (x, y) values representing an arrangement of points.
- distance(x: Number, y: Number) float[source]#
Calculate the minimum distance from the points of this shape to 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 distance from the points of this shape to 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:
- points#
An array of (x, y) values representing an arrangement of points.
- Type:
numpy.array