Commit 3c58c2d6 authored by Pierre-Antoine Rouby's avatar Pierre-Antoine Rouby
Browse files

geometry: Rename point XY to AC.

Showing with 37 additions and 19 deletions
+37 -19
......@@ -4,42 +4,42 @@ from math import dist
from Model.Geometry.Point import Point
class PointXY(Point):
def __init__(self, x:float = 0.0, y:float = 0.0,
class PointAC(Point):
def __init__(self, a:float = 0.0, c:float = 0.0,
name: str = ""):
super(PointXY, self).__init__(name = name)
self._x = float(x)
self._y = float(y)
self._a = float(a)
self._c = float(c)
def __repr__(self):
return f"[{self._x}, {self._y}, {self._name}]"
return f"[{self._a}, {self._c}, {self._name}]"
@property
def x(self):
return self._x
def a(self):
return self._a
@x.setter
def x(self, value):
self._x = float(value)
@a.setter
def a(self, value):
self._a = float(value)
@property
def y(self):
return self._y
def c(self):
return self._c
@y.setter
def y(self, value):
self._y = float(value)
@c.setter
def c(self, value):
self._c = float(value)
@staticmethod
def distance(p1, p2):
"""Euclidean distance between p1 and p2.
Args:
p1: A XY Point
p2: A XY Point
p1: A AC Point
p2: A AC Point
Returns:
Euclidean distance between the two points
"""
return dist((p1.x(), p1.y()), (p2.x(), p2.y()))
return dist((p1.a(), p1.c()), (p2.a(), p2.c()))
......@@ -5,16 +5,34 @@ from pandas import isna as pd_is_na
from Model.Geometry.PointXY import PointXY
class PointXYZ(PointXY):
class PointXYZ(Point):
def __init__(self, x:float = 0.0, y:float = 0.0, z:float = 0.0,
name:str = ""):
super(PointXYZ, self).__init__(x=x, y=y, name=name)
self._x = float(x)
self._y = float(y)
self._z = float(z)
def __repr__(self):
return f"({self._x}, {self._y}, {self._z}, {self._name})"
@property
def x(self):
return self._x
@x.setter
def x(self, value):
self._x = float(value)
@property
def y(self):
return self._y
@y.setter
def y(self, value):
self._y = float(value)
@property
def z(self):
return self._z
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment