Points#

class cake.geometry.points.Point2D(x: Any, y: Any)[source]#

Bases: GeometryO

Represents a co-ordinate on a 2D plane, meaning it only has 2 values x and y.

Parameters:
  • x (Any[Like[cake.BasicNode]]) – Value for co-ordinate

  • y (Any[Like[cake.BasicNode]]) – Value for co-ordinate

as_tuple() Tuple[Any, Any][source]#

Returns point as tuple

classmethod from_tuple(tup: Tuple[Any, Any]) Point2D[source]#

Generates a 2D point from a tuple

Parameters:

tup (Tuple[Any[Like[cake.BasicNode]], Any[Like[cake.BasicNode]]]) – Tuple to create point from

length_to(other: Point2D | Tuple[Any, Any], *, evaluate: bool = True, **ev_kwds) Any[source]#

Calculates the length between 2 points

Parameters:

other (Union[Point2D, Tuple[Any[Like[cake.BasicNode], …]]]) – Point to calcuate distance to

classmethod random(*, start: int = -1000, end: int = 1000) Point2D[source]#