Coordinate

class hotwing_core.Coordinate(x, y)[source]

2 Dimensional X-Y coordinate.

Parameters:
  • x (float) – X value of coordinate
  • y (float) – Y value of coordinate
Variables:
  • x – x coordinate
  • y – y coordinate
__add__(other)[source]

Add two a Coordinate objects

__eq__(other)[source]

Compare two a Coordinate objects

__mul__(other)[source]

Multiply two a Coordinate objects

__ne__(other)[source]

Compare two a Coordinate objects

__sub__(other)[source]

Subtract two a Coordinate objects

classmethod calc_dist(a, b)[source]

Calculate the distance between two Coordinates.

Parameters:
Returns:

Distance between c1 and c2

Return type:

Float

classmethod calc_slope(a, b)[source]

Calculate the slope between two Coordinates.

Parameters:
Returns:

Slope between a and b

Return type:

Float

classmethod rotate(origin, coordinate, angle)[source]

Rotate a Coordinate around a point in 2D space.

Parameters:
  • origin (Coordinate) – Defines the point to rotate around
  • coordinate (Coordinate) – The Coordinate to rotate
  • angle (Float) – Degrees to rotate Coordinate
Returns:

New rotated Coordinate

Return type:

Coordinate