G.528 construct a solid angle out of three plane — Code¶
Construct a solid angle out of three plane angles two of which, taken together in any manner, are greater than the remaining one: thus the three angles must be less than four right angles.
g1.py
"""Programmatic construction for Book XI, Proposition 23 Figure 1 (XI.23 - g1).
Construct the three given isosceles triangles ABC, DEF, GHK containing the
three given plane angles at B, E, H with equal legs AB = BC = DE = EF = GH = HK.
"""
from __future__ import annotations
import sympy as sp
from geometor.model import Model
def construct_g1() -> Model:
"""Construct Figure 1 for Book XI, Proposition 23 using geometor.model."""
model = Model("XI.23.g1")
# Triangle ABC
A = model.set_point(sp.Rational(30, 100), sp.Rational(-132, 100), classes=["given"], label="A")
B = model.set_point(sp.Rational(96, 100), sp.Rational(-29, 100), classes=["given"], label="B")
C = model.set_point(sp.Rational(160, 100), sp.Rational(-132, 100), classes=["given"], label="C")
# Triangle DEF
D = model.set_point(sp.Rational(233, 100), sp.Rational(-132, 100), classes=["given"], label="D")
E = model.set_point(sp.Rational(311, 100), sp.Rational(-42, 100), classes=["given"], label="E")
F = model.set_point(sp.Rational(392, 100), sp.Rational(-132, 100), classes=["given"], label="F")
# Triangle GHK
G = model.set_point(sp.Rational(431, 100), sp.Rational(-132, 100), classes=["given"], label="G")
H = model.set_point(sp.Rational(492, 100), sp.Rational(-35, 100), classes=["given"], label="H")
K = model.set_point(sp.Rational(578, 100), sp.Rational(-132, 100), 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)
# Polygons (Triangles)
model.set_polygon([A, B, C])
model.set_polygon([D, E, F])
model.set_polygon([G, H, K])
# Angles at B, E, H
model.set_wedge(B, A, A, C)
model.set_wedge(E, D, D, F)
model.set_wedge(H, G, G, K)
return model
if __name__ == "__main__":
construct_g1()
g2.py
"""Programmatic construction for Book XI, Proposition 23 Figure 2 (XI.23 - g2).
Construct triangle LMN inscribed in circle (O, L), with auxiliary points P on OL
and Q on OM (PQ parallel to LM), and apex R above the plane of circle LMN such
that OR is perpendicular to the plane and RL = RM = RN = AB.
"""
from __future__ import annotations
import sympy as sp
from geometor.model import Model
def construct_g2() -> Model:
"""Construct Figure 2 for Book XI, Proposition 23 using geometor.model."""
model = Model("XI.23.g2")
# Circumcenter O and vertices L, M, N on circle
O = model.set_point(sp.Rational(110, 82), sp.Rational(-108, 82), classes=["given"], label="O")
L = model.set_point(sp.Rational(79, 82), sp.Rational(-184, 82), classes=["given"], label="L")
M = model.set_point(sp.Rational(38, 82), sp.Rational(-67, 82), classes=["given"], label="M")
N = model.set_point(sp.Rational(192, 82), sp.Rational(-113, 82), classes=["given"], label="N")
# Points P on OL and Q on OM such that PQ is parallel to LM
P = model.set_point(sp.Rational(87, 82), sp.Rational(-165, 82), label="P")
Q = model.set_point(sp.Rational(56, 82), sp.Rational(-77, 82), label="Q")
# Apex R of the solid angle above O
R = model.set_point(sp.Rational(146, 82), sp.Rational(-49, 82), label="R")
# Circumcircle
model.construct_circle(O, L)
# Segments in the base plane
model.set_segment(L, M)
model.set_segment(M, N)
model.set_segment(N, L)
model.set_segment(L, O)
model.set_segment(M, O)
model.set_segment(N, O)
model.set_segment(O, P)
model.set_segment(O, Q)
model.set_segment(L, P)
model.set_segment(Q, M)
model.set_segment(P, Q)
# Segments to apex R
model.set_segment(O, R)
model.set_segment(R, L)
model.set_segment(R, M)
model.set_segment(R, N)
# Polygons (Triangles)
model.set_polygon([L, M, N])
model.set_polygon([L, O, M])
model.set_polygon([M, O, N])
model.set_polygon([N, O, L])
model.set_polygon([P, Q, O])
model.set_polygon([L, R, M])
model.set_polygon([M, R, N])
model.set_polygon([L, R, N])
model.set_polygon([L, O, R])
# Angles
model.set_wedge(O, L, L, M)
model.set_wedge(O, M, M, N)
model.set_wedge(O, N, N, L)
model.set_wedge(O, P, P, Q)
model.set_wedge(O, L, L, R)
model.set_wedge(R, L, L, M)
model.set_wedge(R, M, M, N)
model.set_wedge(R, L, L, N)
return model
if __name__ == "__main__":
construct_g2()
g3.py
"""Programmatic construction for Book XI, Proposition 23 Lemma (XI.23 - g3).
On diameter AB describe semicircle ABC, fit chord AC equal to LO, and join CB
so that angle ACB is right and AB^2 - AC^2 = CB^2.
"""
from __future__ import annotations
import sympy as sp
from geometor.model import Model
def construct_g3() -> Model:
"""Construct the Lemma figure for Book XI, Proposition 23 using geometor.model."""
model = Model("XI.23.g3")
A = model.set_point(-1, 0, classes=["given"], ID="A")
B = model.set_point(1, 0, classes=["given"], ID="B")
O = model.set_point(0, 0, ID="O")
C = model.set_point(0, 1, ID="C")
# Semicircle on AB (modeled via circle centered at midpoint O through A)
model.construct_circle(O, A)
# Segments
model.set_segment(A, B)
model.set_segment(A, C)
model.set_segment(C, B)
# Right triangle ACB
model.set_polygon([A, C, B])
# Right angle ACB
model.set_wedge(C, A, A, B)
return model
if __name__ == "__main__":
construct_g3()