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

Method test_sketch_s_angle

numericals_test.py:248–259  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

246 self.assertAlmostEqual(ang_between(d, f, e), ang_between(a, b, x))
247
248 def test_sketch_s_angle(self):
249 a, b = random_points(2)
250 y = unif(0.0, np.pi)
251 bx = nm.sketch_s_angle([a, b, y / np.pi * 180])
252 self.assertIsInstance(bx, HalfLine)
253 self.assertEqual(bx.tail, b)
254 x = bx.head
255
256 d = Point(1.0, 0.0)
257 e = Point(0.0, 0.0)
258 f = Point(np.cos(y), np.sin(y))
259 self.assertAlmostEqual(ang_between(e, d, f), ang_between(b, a, x))
260
261 def test_sketch_shift(self):
262 a, b, c = random_points(3)

Callers

nothing calls this directly

Calls 4

random_pointsFunction · 0.85
ang_betweenFunction · 0.85
cosMethod · 0.80
PointClass · 0.70

Tested by

no test coverage detected