Make a-b:c-d==m-n:p-q in case a-b==m-n or c-d==p-q.
(
a: gm.Point,
b: gm.Point,
c: gm.Point,
d: gm.Point,
m: gm.Point,
n: gm.Point,
p: gm.Point,
q: gm.Point,
ab: gm.Line,
mn: gm.Line,
g: Any,
level: int,
)
| 643 | |
| 644 | |
| 645 | def maybe_make_equal_pairs( |
| 646 | a: gm.Point, |
| 647 | b: gm.Point, |
| 648 | c: gm.Point, |
| 649 | d: gm.Point, |
| 650 | m: gm.Point, |
| 651 | n: gm.Point, |
| 652 | p: gm.Point, |
| 653 | q: gm.Point, |
| 654 | ab: gm.Line, |
| 655 | mn: gm.Line, |
| 656 | g: Any, |
| 657 | level: int, |
| 658 | ) -> list[Dependency]: |
| 659 | """Make a-b:c-d==m-n:p-q in case a-b==m-n or c-d==p-q.""" |
| 660 | if ab != mn: |
| 661 | return |
| 662 | why = [] |
| 663 | eqname = 'para' if isinstance(ab, gm.Line) else 'cong' |
| 664 | colls = [a, b, m, n] |
| 665 | if len(set(colls)) > 2 and eqname == 'para': |
| 666 | dep = Dependency('collx', colls, None, level) |
| 667 | dep.why_me(g, level) |
| 668 | why += [dep] |
| 669 | |
| 670 | dep = Dependency(eqname, [c, d, p, q], None, level) |
| 671 | dep.why_me(g, level) |
| 672 | why += [dep] |
| 673 | return why |
| 674 | |
| 675 | |
| 676 | class Dependency(Construction): |
no test coverage detected