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

Method distance2

numericals.py:96–101  ·  view source on GitHub ↗
(self, p: Point)

Source from the content-addressed store, hash-verified

94 return np.sqrt(dx * dx + dy * dy)
95
96 def distance2(self, p: Point) -> float:
97 if isinstance(p, Line):
98 return p.distance(self)
99 dx = self.x - p.x
100 dy = self.y - p.y
101 return dx * dx + dy * dy
102
103 def rotatea(self, ang: float) -> Point:
104 sinb, cosb = np.sin(ang), np.cos(ang)

Callers

nothing calls this directly

Calls 1

distanceMethod · 0.45

Tested by

no test coverage detected