G.385 magnitudes commensurable incommensurable — Code

X.13

If two magnitudes be commensurable, and the one of them be incommensurable with any magnitude, the remaining one is incommensurable with the same.

g1.py

A C B
"""Programmatic construction for Book X, Proposition 13 (X.13 - g1)."""

        from __future__ import annotations

        from geometor.model import Model


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

            # Magnitudes A, C, B
            A_l = model.set_point(30.0, -18.5, classes=["given"], ID="A")
            A_r = model.set_point(141.0, -18.5, ID="A_r")

            C_l = model.set_point(28.0, -40.5, classes=["given"], ID="C")
            C_r = model.set_point(127.0, -40.5, ID="C_r")

            B_l = model.set_point(28.0, -60.5, classes=["given"], ID="B")
            B_r = model.set_point(167.0, -60.5, ID="B_r")

            for p_l, p_r in [(A_l, A_r), (C_l, C_r), (B_l, B_r)]:
                model.construct_line(p_l, p_r)
                model.set_segment(p_l, p_r)

            return model


        if __name__ == "__main__":
            construct_g1()
        

g2.py

A D B C
"""Programmatic construction for Book X, Proposition 13 Lemma (X.13 - g2)."""

        from __future__ import annotations

        from geometor.model import Model


        def construct_g2() -> Model:
            """Construct the figure 0040.g2 using geometor.model."""
            model = Model("X.13.g2")

            # Diameter AB and midpoint M of semicircle ADB
            A = model.set_point(19.5, -90.0, classes=["given"], ID="A")
            B = model.set_point(162.5, -90.0, classes=["given"], ID="B")
            M = model.set_point(91.0, -90.0, ID="M")
            D = model.set_point(55.0, -28.1, ID="D")

            # Standalone given straight line C
            C_t = model.set_point(206.5, -18.0, classes=["given"], ID="C")
            C_b = model.set_point(206.5, -90.0, ID="C_b")

            # Base lines and circle (semicircle ADB)
            model.construct_line(A, B)
            model.construct_line(A, D)
            model.construct_line(D, B)
            model.construct_circle(M, B)
            model.construct_line(C_t, C_b)

            # Segments
            model.set_segment(A, B)
            model.set_segment(A, D)
            model.set_segment(D, B)
            model.set_segment(C_t, C_b)

            # Inscribed right triangle ADB
            model.set_polygon([A, D, B])

            # Right angle ADB
            model.set_wedge(D, A, A, B)

            return model


        if __name__ == "__main__":
            construct_g2()