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

Function sketch_amirror

numericals.py:1510–1523  ·  view source on GitHub ↗

Sketch the angle mirror.

(args: tuple[gm.Point, ...])

Source from the content-addressed store, hash-verified

1508
1509
1510def sketch_amirror(args: tuple[gm.Point, ...]) -> HalfLine:
1511 """Sketch the angle mirror."""
1512 A, B, C = args # pylint: disable=invalid-name
1513 ab = A - B
1514 cb = C - B
1515
1516 dab = A.distance(B)
1517 ang_ab = np.arctan2(ab.y / dab, ab.x / dab)
1518 dcb = C.distance(B)
1519 ang_bc = np.arctan2(cb.y / dcb, cb.x / dcb)
1520
1521 ang_bx = 2 * ang_bc - ang_ab
1522 X = B + Point(np.cos(ang_bx), np.sin(ang_bx)) # pylint: disable=invalid-name
1523 return HalfLine(B, X)
1524
1525
1526def sketch_bisect(args: tuple[gm.Point, ...]) -> Line:

Callers

nothing calls this directly

Calls 4

HalfLineClass · 0.85
cosMethod · 0.80
PointClass · 0.70
distanceMethod · 0.45

Tested by

no test coverage detected