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

Function sketch_eq_quadrangle

numericals.py:1613–1626  ·  view source on GitHub ↗

Sketch quadrangle with two equal opposite sides.

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

Source from the content-addressed store, hash-verified

1611
1612
1613def sketch_eq_quadrangle(args: tuple[gm.Point, ...]) -> tuple[Point, ...]:
1614 """Sketch quadrangle with two equal opposite sides."""
1615 a = Point(0.0, 0.0)
1616 b = Point(1.0, 0.0)
1617
1618 length = np.random.uniform(0.5, 2.0)
1619 ang = np.random.uniform(np.pi / 3, np.pi * 2 / 3)
1620 d = head_from(a, ang, length)
1621
1622 ang = ang_of(b, d)
1623 ang = np.random.uniform(ang / 10, ang / 9)
1624 c = head_from(b, ang, length)
1625 a, b, c, d = random_rfss(a, b, c, d)
1626 return a, b, c, d
1627
1628
1629def sketch_eq_trapezoid(args: tuple[gm.Point, ...]) -> tuple[Point, ...]:

Callers

nothing calls this directly

Calls 4

head_fromFunction · 0.85
ang_ofFunction · 0.85
random_rfssFunction · 0.85
PointClass · 0.70

Tested by

no test coverage detected