G.500 area contained apotome — Code

X.114

If an area be contained by an apotome and the binomial segment the terms of which are commensurable with the terms of the apotome and in the same ratio, the “side” of the area is rational.
A B F C E D G H K L M
"""Programmatic construction for Book X, Proposition 114 (X.114)."""

        from __future__ import annotations

        from geometor.model import Model


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

            # Line AF divided at B
            A = model.set_point(55.0, -19.0, classes=["given"], ID="A")
            B = model.set_point(128.0, -19.0, classes=["given"], ID="B")
            F = model.set_point(168.0, -19.0, classes=["given"], ID="F")

            # Line CD divided at E
            C = model.set_point(17.0, -49.5, classes=["given"], ID="C")
            E = model.set_point(164.0, -49.5, classes=["given"], ID="E")
            D = model.set_point(217.0, -49.5, classes=["given"], ID="D")

            # Single-letter magnitude segments G and H
            G_l = model.set_point(49.0, -81.0, classes=["given"], ID="G")
            G_r = model.set_point(171.0, -81.0, ID="G_r")

            H_l = model.set_point(38.0, -111.5, classes=["given"], ID="H")
            H_r = model.set_point(182.0, -111.5, ID="H_r")

            # Line KM divided at L
            K = model.set_point(35.0, -143.5, ID="K")
            L = model.set_point(133.0, -143.5, ID="L")
            M = model.set_point(185.0, -143.5, ID="M")

            # Base lines
            model.construct_line(A, F)
            model.construct_line(C, D)
            model.construct_line(G_l, G_r)
            model.construct_line(H_l, H_r)
            model.construct_line(K, M)

            # Segments
            model.set_segment(A, F)
            model.set_segment(A, B)
            model.set_segment(B, F)
            model.set_segment(C, D)
            model.set_segment(C, E)
            model.set_segment(E, D)
            model.set_segment(G_l, G_r)
            model.set_segment(H_l, H_r)
            model.set_segment(K, M)
            model.set_segment(K, L)
            model.set_segment(L, M)

            # Sections
            model.set_section([A, B, F])
            model.set_section([C, E, D])
            model.set_section([K, L, M])

            return model


        if __name__ == "__main__":
            construct_g1()