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

Function ang_between

numericals.py:1255–1264  ·  view source on GitHub ↗
(tail: Point, head1: Point, head2: Point)

Source from the content-addressed store, hash-verified

1253
1254
1255def ang_between(tail: Point, head1: Point, head2: Point) -> float:
1256 ang1 = ang_of(tail, head1)
1257 ang2 = ang_of(tail, head2)
1258 diff = ang1 - ang2
1259 # return diff % (2*np.pi)
1260 if diff > np.pi:
1261 return diff - 2 * np.pi
1262 if diff < -np.pi:
1263 return 2 * np.pi + diff
1264 return diff
1265
1266
1267def head_from(tail: Point, ang: float, length: float = 1) -> Point:

Callers 12

test_sketch_alineMethod · 0.85
test_sketch_amirrorMethod · 0.85
test_sketch_bisectMethod · 0.85
test_sketch_e5128Method · 0.85
test_sketch_eqangle2Method · 0.85
test_sketch_isosMethod · 0.85
test_sketch_rotaten90Method · 0.85
test_sketch_rotatep90Method · 0.85
test_sketch_s_angleMethod · 0.85
test_sketch_trisectMethod · 0.85
check_aconstFunction · 0.85
sketch_eqangle3Function · 0.85

Calls 1

ang_ofFunction · 0.85

Tested by 10

test_sketch_alineMethod · 0.68
test_sketch_amirrorMethod · 0.68
test_sketch_bisectMethod · 0.68
test_sketch_e5128Method · 0.68
test_sketch_eqangle2Method · 0.68
test_sketch_isosMethod · 0.68
test_sketch_rotaten90Method · 0.68
test_sketch_rotatep90Method · 0.68
test_sketch_s_angleMethod · 0.68
test_sketch_trisectMethod · 0.68