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

Function sketch_quadrangle

numericals.py:1750–1765  ·  view source on GitHub ↗

Sketch a random quadrangle.

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

Source from the content-addressed store, hash-verified

1748
1749
1750def sketch_quadrangle(args: tuple[gm.Point, ...]) -> tuple[Point, ...]:
1751 """Sketch a random quadrangle."""
1752 m = unif(0.3, 0.7)
1753 n = unif(0.3, 0.7)
1754
1755 a = Point(-m, 0.0)
1756 c = Point(1 - m, 0.0)
1757 b = Point(0.0, -unif(0.25, 0.75))
1758 d = Point(0.0, unif(0.25, 0.75))
1759
1760 ang = unif(-0.25 * np.pi, 0.25 * np.pi)
1761 sin, cos = np.sin(ang), np.cos(ang)
1762 b = b.rotate(sin, cos)
1763 d = d.rotate(sin, cos)
1764 a, b, c, d = random_rfss(a, b, c, d)
1765 return a, b, c, d
1766
1767
1768def sketch_r_trapezoid(args: tuple[gm.Point, ...]) -> tuple[Point, ...]:

Callers

nothing calls this directly

Calls 4

rotateMethod · 0.95
random_rfssFunction · 0.85
cosMethod · 0.80
PointClass · 0.70

Tested by

no test coverage detected