Add circle_points to Circle and round() to Points

This commit is contained in:
2024-06-11 15:29:57 +02:00
parent 9433503ddd
commit b39c9d13dd
6 changed files with 59 additions and 22 deletions

View File

@@ -75,3 +75,9 @@ class Point2D:
angle = math.atan2(np.linalg.det([v0, v1]), np.dot(v0, v1))
return np.degrees(angle)
def round(self, ndigits: int = None) -> "Point2D":
self.x = round(self.x, ndigits)
self.y = round(self.y, ndigits)
self.coordinate = (self.x, self.y)
return self