Add nearest support to Point3D

This commit is contained in:
2024-06-11 17:04:40 +02:00
parent b39c9d13dd
commit ac86f8588e
4 changed files with 34 additions and 16 deletions

View File

@@ -17,10 +17,6 @@ def optimized_path(points, start=None):
return path
def nearest(points, start):
return min(points, key=lambda x: distance(start, x))
def sort_by_clockwise(points):
"""
Sort point in a rotation order. Works in 2d but supports 3d.