Sketch a random quadrangle.
(args: tuple[gm.Point, ...])
| 1748 | |
| 1749 | |
| 1750 | def 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 | |
| 1768 | def sketch_r_trapezoid(args: tuple[gm.Point, ...]) -> tuple[Point, ...]: |
nothing calls this directly
no test coverage detected