W.14 Menelaus, Ceva & The Alternate Spreads Theorem — Code

If either a transversal line l cuts the sidelines A_2 A_3, A_3 A_1, A_1 A_2 of a non-null triangle at B_1, B_2, B_3 (Menelaus) or three cevians through a point A_0 meet the opposite sidelines at B_1, B_2, B_3 (Ceva), then the six segment quadrances satisfy Q(A_2, B_1) * Q(A_3, B_2) * Q(A_1, B_3) = Q(B_1, A_3) * Q(B_2, A_1) * Q(B_3, A_2).
t / A_1 B_1 / (Q = 44064/529) / A_2 B_2 / (Q = 75168/625) / A_3 B_3 / (Q = 333/4) A_1 = [0, 0] A_2 = [12, 0] A_3 = [4, 9] A_0 = [5, 3] B_1 = [180/23, 108/23] B_2 = [48/25, 108/25] B_3 = [11/2, 0] Ceva Q-product = 2070829332/66125 Alt Spreads r_1*r_2*r_3 = 14907321/1026238660 A1A1 A2A2 A3A3 A0A0 B1B1 B2B2 B3B3 + − ⟲ Lbl Gde

Exact geometor.model SVG output of model.py for W.14 (Menelaus, Ceva & The Alternate Spreads Theorem).

Symbolic Construction & Verification Script (model.py)

"""GEOMETOR Wildberger symbolic model and proof script for W.14: Menelaus, Ceva & The Alternate Spreads Theorem.

        Enunciation: If either a transversal line l cuts the sidelines A_2 A_3, A_3 A_1, A_1 A_2 of a non-null triangle at B_1, B_2, B_3 (Menelaus) or three cevians through a point A_0 meet the opposite sidelines at B_1, B_2, B_3 (Ceva), then the six segment quadrances satisfy Q(A_2, B_1) * Q(A_3, B_2) * Q(A_1, B_3) = Q(B_1, A_3) * Q(B_2, A_1) * Q(B_3, A_2).
        """

        from __future__ import annotations

        import sys
        from pathlib import Path

        _ROOT_SRC = Path(__file__).resolve().parents[3] / "src"
        if str(_ROOT_SRC) not in sys.path:
            sys.path.insert(0, str(_ROOT_SRC))

        from geometor.wildberger.models import (  # noqa: E402
            TopicBuildResult,
            assert_zero_floats,
            build_principle_model,
        )
        from geometor.wildberger.render import render_svg  # noqa: E402


        def construct_w_14() -> TopicBuildResult:
            """Construct the exact symbolic model and verifications for W.14.

            Returns:
                Populated `TopicBuildResult` for W.14 (Menelaus, Ceva & The Alternate Spreads Theorem).
            """
            result = build_principle_model("W.14")
            assert_zero_floats(result.model)
            return result


        def main() -> None:
            """Execute W.14 symbolic construction, render `w-14.svg`, and print invariants."""
            here = Path(__file__).resolve().parent
            bundle = construct_w_14()
            svg_out = render_svg(
                bundle.model,
                here / "w-14.svg",
                extra_curves=bundle.extra_curves,
                annotations=bundle.annotations,
            )
            print("W.14: Menelaus, Ceva & The Alternate Spreads Theorem")
            print(f"  Elements in model: {len(bundle.model)}")
            print(f"  Rendered SVG:      {svg_out.name}")
            for label, val, status in bundle.verifications:
                print(f"  [OK] {label}: {val} ({status})")


        if __name__ == "__main__":
            main()