G.411 medial segments commensurable — Code

X.37

If two medial segments commensurable in square only and containing a rational rectangle be added together, the whole is irrational; and let it be called a first bimedial segment.
A B C
"""Programmatic construction for Book X, Proposition 37 (X.37)."""

        from __future__ import annotations

        from geometor.model import Model


        def construct_g1() -> Model:
            """Construct the figure 0088.g1 using geometor.model."""
            model = Model("X.37")

            # Straight line AC divided into medial straight lines AB, BC
            A = model.set_point(16.0, -20.0, classes=["given"], ID="A")
            B = model.set_point(145.0, -20.0, classes=["given"], ID="B")
            C = model.set_point(242.0, -20.0, classes=["given"], ID="C")

            model.construct_line(A, C)

            model.set_segment(A, C)
            model.set_segment(A, B)
            model.set_segment(B, C)

            model.set_section([A, B, C])

            return model


        if __name__ == "__main__":
            construct_g1()