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

@@ -1,5 +1,4 @@
from networks.geometry.Point2D import Point2D
from networks.geometry.point_tools import coordinates_to_vectors
from math import sqrt, inf
import numpy as np
@@ -19,7 +18,7 @@ class Polyline:
>>> Polyline((Point2D(0, 0), Point2D(0, 10), Point2D(50, 10), Point2D(20, 20)))
"""
self.points = coordinates_to_vectors(points)
self.points = Point2D.to_vectors(points)
self.length_polyline = len(points)
if self.length_polyline < 4:
@@ -37,6 +36,9 @@ class Polyline:
self._alpha_assign(0, self.length_polyline-1)
def __repr__(self):
return str(self.alpha_radii)
def _alpha_assign(self, start_index: int, end_index: int):
"""
The alpha-assign procedure assigning radii based on a polyline.