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

Method test_sketch_square

numericals_test.py:266–272  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

264 self.assertTrue((b - a).close(x - c))
265
266 def test_sketch_square(self):
267 a, b = random_points(2)
268 c, d = nm.sketch_square([a, b])
269 self.assertTrue(Line(a, b).is_perp(Line(b, c)))
270 self.assertTrue(Line(b, c).is_perp(Line(c, d)))
271 self.assertTrue(Line(c, d).is_perp(Line(d, a)))
272 self.assertAlmostEqual(a.distance(b), b.distance(c))
273
274 def test_sketch_isquare(self):
275 a, b, c, d = nm.sketch_isquare([])

Callers

nothing calls this directly

Calls 4

random_pointsFunction · 0.85
is_perpMethod · 0.80
LineClass · 0.70
distanceMethod · 0.45

Tested by

no test coverage detected