Move to_vectors to Points

This commit is contained in:
2024-06-11 18:59:14 +02:00
parent 229c43c308
commit f98af90b3e
6 changed files with 29 additions and 58 deletions

View File

@@ -181,3 +181,14 @@ class Point2D:
self.y = round(self.y, ndigits)
self.coordinate = (self.x, self.y)
return self
@staticmethod
def to_vectors(points: List["Point3D"]):
vectors = []
for point in points:
vectors.append(np.array(point.coordinate))
if (len(vectors) == 1):
return vectors[0]
else:
return vectors