MCPcopy Create free account
hub / github.com/google-deepmind/alphageometry / check_too_close

Function check_too_close

numericals.py:588–599  ·  view source on GitHub ↗
(
    newpoints: list[Point], points: list[Point], tol: int = 0.1
)

Source from the content-addressed store, hash-verified

586
587
588def check_too_close(
589 newpoints: list[Point], points: list[Point], tol: int = 0.1
590) -> bool:
591 if not points:
592 return False
593 avg = sum(points, Point(0.0, 0.0)) * 1.0 / len(points)
594 mindist = min([p.distance(avg) for p in points])
595 for p0 in newpoints:
596 for p1 in points:
597 if p0.distance(p1) < tol * mindist:
598 return True
599 return False
600
601
602def check_too_far(

Callers 1

try_to_sketch_intersectFunction · 0.85

Calls 2

PointClass · 0.70
distanceMethod · 0.45

Tested by

no test coverage detected