polygons#
Polygon shapes made from lines.
Classes
|
Class for the diamond shape. |
|
Class for the rectangle shape. |
|
Class for the star shape. |
- class data_morph.shapes.polygons.Diamond(dataset: Dataset)[source]#
Bases:
LineCollection
Class for the diamond shape.
- Parameters:
dataset (Dataset) – The starting dataset to morph into other shapes.
- distance(x: Number, y: Number) float #
Calculate the minimum distance from the lines 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 lines of this shape to the point (x, y).
- Return type:
- lines#
An iterable of two (x, y) pairs representing the endpoints of a line.
- Type:
Iterable[Iterable[numbers.Number]]
- class data_morph.shapes.polygons.Rectangle(dataset: Dataset)[source]#
Bases:
LineCollection
Class for the rectangle shape.
- Parameters:
dataset (Dataset) – The starting dataset to morph into other shapes.
- distance(x: Number, y: Number) float #
Calculate the minimum distance from the lines 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 lines of this shape to the point (x, y).
- Return type:
- lines#
An iterable of two (x, y) pairs representing the endpoints of a line.
- Type:
Iterable[Iterable[numbers.Number]]
- class data_morph.shapes.polygons.Star(dataset: Dataset)[source]#
Bases:
LineCollection
Class for the star shape.
- Parameters:
dataset (Dataset) – The starting dataset to morph into other shapes.
- distance(x: Number, y: Number) float #
Calculate the minimum distance from the lines 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 lines of this shape to the point (x, y).
- Return type:
- lines#
An iterable of two (x, y) pairs representing the endpoints of a line.
- Type:
Iterable[Iterable[numbers.Number]]