G.527 there plane angles — Code

XI.22

If there be three plane angles of which two, taken together in any manner, are greater than the remaining one, and they are contained by equal segments, it is possible to construct a triangle out of the segments joining the extremities of the equal segments.

g1.py

B A C E D F H G K
"""Programmatic construction for Book XI, Proposition 22 Figure 1 (XI.22 - g1).

        Three plane angles ABC, DEF, GHK of which any two are greater than the remaining
        one, contained by equal straight lines AB, BC, DE, EF, GH, HK, with bases AC,
        DF, GK joined.
        """

        from __future__ import annotations

        import sympy as sp
        from geometor.model import Model


        def construct_g1() -> Model:
            """Construct Figure 1 for Book XI, Proposition 22 using geometor.model."""
            model = Model("XI.22.g1")

            # 1. Three plane angles ABC, DEF, GHK contained by equal straight lines
            #    AB, BC, DE, EF, GH, HK, with bases AC, DF, GK joined.
            A = model.set_point(0, 0, classes=["given"], ID="A")
            B = model.set_point(sp.Rational(67, 130), sp.Rational(108, 130), classes=["given"], label="B")
            C = model.set_point(1, 0, classes=["given"], ID="C")

            D = model.set_point(sp.Rational(170, 130), 0, classes=["given"], label="D")
            E = model.set_point(sp.Rational(255, 130), sp.Rational(94, 130), classes=["given"], label="E")
            F = model.set_point(sp.Rational(337, 130), 0, classes=["given"], label="F")

            G = model.set_point(sp.Rational(378, 130), 0, classes=["given"], label="G")
            H = model.set_point(sp.Rational(414, 130), sp.Rational(116, 130), classes=["given"], label="H")
            K = model.set_point(sp.Rational(453, 130), 0, classes=["given"], label="K")

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

            model.set_segment(D, E)
            model.set_segment(E, F)
            model.set_segment(D, F)

            model.set_segment(G, H)
            model.set_segment(H, K)
            model.set_segment(G, K)

            # Triangles
            model.set_polygon([A, B, C])
            model.set_polygon([D, E, F])
            model.set_polygon([G, H, K])

            return model


        if __name__ == "__main__":
            construct_g1()
        

g2.py

H L G K
"""Programmatic construction for Book XI, Proposition 22 Figure 2 (XI.22 - g2).

        On the straight line HK, and at the point H on it, construct the angle KHL equal
        to the angle ABC, make HL equal to HK, and join KL, GL.
        """

        from __future__ import annotations

        import sympy as sp
        from geometor.model import Model


        def construct_g2() -> Model:
            """Construct Figure 2 for Book XI, Proposition 22 using geometor.model."""
            model = Model("XI.22.g2")

            # 1. Triangle GHK with angle KHL constructed on HK equal to angle ABC,
            #    HL made equal to HK, and KL, GL joined.
            H = model.set_point(0, 1, classes=["given"], ID="H")
            G = model.set_point(sp.Rational(-32, 121), 0, classes=["given"], label="G")
            K = model.set_point(sp.Rational(41, 121), sp.Rational(4, 121), classes=["given"], label="K")
            L = model.set_point(sp.Rational(118, 121), sp.Rational(85, 121), label="L")

            # Segments
            model.set_segment(G, H)
            model.set_segment(H, K)
            model.set_segment(G, K)
            model.set_segment(H, L)
            model.set_segment(K, L)
            model.set_segment(G, L)

            # Triangles
            model.set_polygon([G, H, K])
            model.set_polygon([K, H, L])
            model.set_polygon([G, H, L])
            model.set_polygon([G, K, L])

            return model


        if __name__ == "__main__":
            construct_g2()