Modules

geometor.pappus

Pappus of Alexandria’s Synagoge (Mathematical Collection) and symbolic projective geometry.

Unifies two complementary layers in a single package:

  1. Exact Classical & Projective Constructions (geometor.pappus.synagoge_demos, geometor.pappus.constructions, geometor.pappus.pascal, geometor.pappus.projective): SymPy and geometor.model constructions spanning Book III’s three classical means in one semicircle, Book IV’s Area Theorem and infinite Arbelos tangent circle chain (\(y_n = n d_n\)), Book V’s hexagonal honeycomb isoperimetry, Book VII’s Hexagon Theorem (Synagoge VII.138 & 139), Steiner’s six-line configuration \((S_+, S_-)\), and Blaise Pascal’s 60-line Hexagrammum Mysticum (1640).

  2. Multi-Track *Synagoge* Book Codex Infrastructure (geometor.pappus.sphinx_ext): Sphinx companion-track registration (-en, -el, -summary, -notes) and offline cross-codex intersphinx wiring for photon_platform.publish.

Submodules

Attributes

PERMUTATIONS_S3

PRESETS

TYPE_NAMES

PASCAL_PRESETS

Cycle6

PHI

EMBEDDED_SVG_STYLE

__version__

Classes

HarmonicFourthResult

Structured output from construct_harmonic_fourth().

PappusConfigurationResult

Structured output from construct_pappus_configuration().

PappusHexagonResult

Structured output from construct_pappus_hexagon().

PresetConfig

Canonical exact coordinate preset for projective explorations.

HexagrammumMysticumCatalog

Complete projective catalog of the 60-line Hexagrammum Mysticum configuration.

PascalHexagonResult

Structured output from construct_pascal_hexagon().

PascalPresetConfig

Exact coordinate preset for Pascal Hexagrammum Mysticum constructions.

PascalSteinerFamilyResult

Structured output from construct_pascal_steiner_family().

GoldenRange

Represents three ordered collinear points dividing a segment in the Golden Ratio $phi$.

HarmonicRange

Represents four ordered collinear points forming a harmonic range $(P_1, P_3; P_2, P_4) = -1$.

ArbelosChainResult

Exact symbolic result for Pappus's Ancient Proposition on the Arbelos (Synagoge IV.14–18).

ArbelosCircle

Exact symbolic record for the $n$-th tangent circle in Pappus's Arbelos chain.

HoneycombIsoperimetryResult

Exact symbolic result for Book V's Honeycomb Isoperimetry & Book VIII's 7-Hexagon Cluster.

PappusAreaResult

Exact symbolic result for Pappus's Area Theorem (Synagoge Book IV, Prop. 1).

ThreeMeansResult

Exact symbolic result for Pappus's semicircle construction of the three means.

Functions

construct_harmonic_fourth([model, pt_a, pt_b, pt_c, ...]) → HarmonicFourthResult

Construct the fourth harmonic conjugate $D$ of $C$ with respect to $(A, B)$ by straightedge alone.

construct_pappus_configuration([model, a_points, ...]) → PappusConfigurationResult

Construct the complete $S_3$ six-permutation Pappus–Steiner configuration.

construct_pappus_hexagon([model, a_points, b_points, ...]) → PappusHexagonResult

Construct Pappus's Hexagon Theorem for a single permutation $sigma in S_3$.

get_preset([name]) → PresetConfig

Look up a named exact coordinate preset from PRESETS.

permutation_parity(perm) → str

Return "even" or "odd" for a permutation of (0, 1, 2).

verify_pappus_symbolic() → sympy.Expr

Prove Pappus's Hexagon Theorem universally over a symbolic function field.

canonical_hexagon_cycle(cycle) → Cycle6

Normalize a 6-vertex permutation up to dihedral rotation and reversal ($D_6$).

construct_pascal_hexagon([model, points, cycle, ...]) → PascalHexagonResult

Construct Blaise Pascal's Hexagrammum Mysticum for six points on a conic.

construct_pascal_steiner_family([model, points, ...]) → PascalSteinerFamilyResult

Construct the 6-hexagon \(S_3\) bi-triangle Pascal family and its two Steiner points.

enumerate_hexagrammum_mysticum([points, preset]) → HexagrammumMysticumCatalog

Enumerate and verify the complete 60-line Hexagrammum Mysticum web in $mathbb{P}^2$.

get_pascal_preset(name) → PascalPresetConfig

Look up a named Pascal preset in PASCAL_PRESETS.

verify_pascal_symbolic() → sympy.Expr

Prove Pascal's Hexagrammum Mysticum universally over $mathbb{Z}[t_0, t_1, t_2, t_3, t_4, t_5]$.

anharmonic_orbit(lam) → list[sympy.Expr]

Return the six cross-ratio values generated by permuting four collinear points.

are_coconic(points) → bool

Return True iff all given points lie on a single conic (smooth or degenerate line-pair).

circle_stereographic_point(t, *[, center, radius]) → sympy.geometry.Point

Compute an exact point on $(x - x_0)^2 + (y - y_0)^2 = R^2$ via rational stereographic slope $t$.

conic_cross_ratio(p1, p2, p3, p4, observer) → sympy.Expr

Compute Michel Chasles's projective cross-ratio $(P_1, P_2; P_3, P_4)_{mathcal{C}}$ on a conic.

conic_equation_through_points(points) → sympy.Expr

Construct the exact quadratic conic polynomial $C(x, y)$ through five points.

cross_ratio(pt_a, pt_b, pt_c, pt_d, *[, check_collinear]) → sympy.Expr

Compute the exact projective cross-ratio $(A, B; C, D)$ of four collinear points.

enable_divine_analysis(model) → geometor.model.Model

Attach geometor.divine.register_divine_hook() to model and return it.

exact_line_meet(line_1, line_2) → sympy.geometry.Point | None

Compute the exact intersection of two lines via Cramer's rule.

find_golden_sections(model, *[, register_sections, ...]) → list[GoldenRange]

Scan all lines in a Model for exact Golden Ratio sections.

find_harmonic_ranges(model[, line, include_guides]) → list[HarmonicRange]

Scan lines in a Model for exact collinear harmonic tetrads.

harmonic_conjugate_point(pt_a, pt_b, pt_c) → sympy.geometry.Point

Compute the exact algebraic fourth harmonic point $D$ such that $(A, B; C, D) = -1$.

is_harmonic_range(pt_a, pt_b, pt_c, pt_d) → bool

Determine whether $(A, B; C, D) = -1$ in exact symbolic arithmetic.

line_spread(line_1, line_2) → sympy.Expr

Compute the exact rational-trigonometric spread $s(ell_1, ell_2) = sin^2theta$.

project_point(center, target_line, pt) → sympy.geometry.Point

Project a point from a perspective center onto a target line.

quadrance(pt_1, pt_2) → sympy.Expr

Compute the exact rational-trigonometric quadrance $Q(P_1, P_2)$.

export_svg(model, output_path, *[, graphic_id, title, ...]) → pathlib.Path

Write an interactive SVG rendering of model to output_path.

render_svg_string(model, *[, graphic_id, title, ...]) → str

Render a Model into a complete interactive SVG string.

build_synagoge_gallery([output_dir]) → list[pathlib.Path]

Generate publication-grade interactive .euclid-graphic SVGs for the Synagoge Codex.

construct_honeycomb_isoperimetry([perimeter, model]) → geometor.model.Model

Construct an exact Model for Book V's Honeycomb & Book VIII.23's 7-Hexagon Circle.

construct_pappus_arbelos_chain([model_or_r1, ...]) → ArbelosChainResult

Construct Pappus's Arbelos tangent circle chain (Synagoge IV.14–18, Hultsch I, pp. 208–227).

construct_pappus_area_theorem([model, preset, ...]) → PappusAreaResult

Construct Pappus's Area Theorem (Synagoge Book IV, Prop. 1, Hultsch I, pp. 176–179).

construct_three_means([model_or_a, a_or_b, b, model, ...]) → ThreeMeansResult

Construct Pappus's semicircle diagram exhibiting the three classical means (Synagoge III.5–16).

signed_area2(p1, p2, p3) → sympy.Expr

Return twice the signed Euclidean area $det(p_2 - p_1, p_3 - p_1)$ of $triangle p_1 p_2 p_3$.

verify_arbelos_chain_symbolic([n_max]) → dict[str, sympy.Expr]

Prove Pappus's Arbelos Theorem symbolically over $mathbb{Q}(r_1, r_2, n)$.

verify_honeycomb_isoperimetry([perimeter, build_model]) → HoneycombIsoperimetryResult

Verify Pappus's Book V Honeycomb Isoperimetry & Regular Planar Tiling Theorem.

verify_pappus_area_symbolic() → sympy.Expr

Verify Pappus's Area Theorem universally over $mathbb{Q}(x_A, y_A, x_B, y_B, x_C, y_C, u_x, u_y, v_x, v_y)$.

Package Contents

geometor.pappus.PERMUTATIONS_S3: tuple[Perm3, ...]
geometor.pappus.PRESETS: dict[str, PresetConfig]
geometor.pappus.TYPE_NAMES: tuple[str, str, str] = ('square', 'circle', 'diamond')
class geometor.pappus.HarmonicFourthResult

Structured output from construct_harmonic_fourth().

Variables:
  • model – Populated Model.

  • pt_a – First base point $A$.

  • pt_b – Second base point $B$.

  • pt_c – Interior/exterior third collinear point $C$.

  • pt_d – Constructed fourth harmonic conjugate $D$ satisfying $(A, B; C, D) = -1$.

  • apex – Complete quadrilateral apex $P$ off $[A B]$.

  • relay – Auxiliary point $Q$ chosen on $[P C]$.

  • diag_r – Opposite side intersection $R = [A Q] cap [P B]$.

  • diag_s – Opposite side intersection $S = [B Q] cap [P A]$.

  • base_line – Carrier line $[A B]$.

  • conjugate_line – Diagonal line $[R S]$ cutting $[A B]$ at $D$.

model: geometor.model.Model
pt_a: sympy.geometry.Point
pt_b: sympy.geometry.Point
pt_c: sympy.geometry.Point
pt_d: sympy.geometry.Point
apex: sympy.geometry.Point
relay: sympy.geometry.Point
diag_r: sympy.geometry.Point
diag_s: sympy.geometry.Point
base_line: sympy.geometry.Line
conjugate_line: sympy.geometry.Line
class geometor.pappus.PappusConfigurationResult

Structured output from construct_pappus_configuration().

Variables:
  • model – Populated Model containing all 6 permutations.

  • a_points – Tuple $(A_0, A_1, A_2)$ on carrier line $a$.

  • b_points – Tuple $(B_0, B_1, B_2)$ on carrier line $b$.

  • line_a – Carrier line $a$.

  • line_b – Carrier line $b$.

  • apex – Carrier intersection $O = a cap b$, or None if parallel.

  • cross_lines – All 9 cross-join lines (i, j) -> [A_i B_j].

  • meets_by_perm – Mapping perm -> (M_01, M_12, M_20) for each $sigma in S_3$.

  • all_meets – Mapping of clean point ID (e.g. "M0110") to each finite cross-join meet.

  • pappus_lines – Mapping perm -> Line for all 6 Pappus lines.

  • even_pappus_lines – Tuple of the 3 even Pappus lines ($sigma in A_3$).

  • odd_pappus_lines – Tuple of the 3 odd Pappus lines ($sigma in S_3 setminus A_3$).

  • steiner_even – Even Steiner (“Star”) concurrency point \(S_+\) (ID "S1"), if finite.

  • steiner_odd – Odd Steiner (“Star”) concurrency point \(S_-\) (ID "S2"), if finite.

  • steiner_line – Steiner line \([S_+ S_-]\) joining the two star points, if both finite and distinct.

  • harmonic_ranges – Discovered HarmonicRange records.

  • golden_sections – Discovered GoldenRange records.

model: geometor.model.Model
a_points: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
b_points: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
line_a: sympy.geometry.Line
line_b: sympy.geometry.Line
apex: sympy.geometry.Point | None
cross_lines: dict[tuple[int, int], sympy.geometry.Line]
meets_by_perm: dict[Perm3, tuple[sympy.geometry.Point | None, sympy.geometry.Point | None, sympy.geometry.Point | None]]
all_meets: dict[str, sympy.geometry.Point]
pappus_lines: dict[Perm3, sympy.geometry.Line]
even_pappus_lines: tuple[sympy.geometry.Line, sympy.geometry.Line, sympy.geometry.Line]
odd_pappus_lines: tuple[sympy.geometry.Line, sympy.geometry.Line, sympy.geometry.Line]
steiner_even: sympy.geometry.Point | None
steiner_odd: sympy.geometry.Point | None
steiner_line: sympy.geometry.Line | None
harmonic_ranges: list[geometor.pappus.projective.HarmonicRange]
golden_sections: list[geometor.pappus.projective.GoldenRange]
class geometor.pappus.PappusHexagonResult

Structured output from construct_pappus_hexagon().

Variables:
  • model – Populated Model.

  • perm – Permutation $sigma = (sigma_0, sigma_1, sigma_2)$ applied to $B$.

  • parity – "even" or "odd" parity of perm.

  • a_points – Tuple $(A_0, A_1, A_2)$ in model.

  • b_points – Original tuple $(B_0, B_1, B_2)$ in model.

  • b_permuted – Permuted tuple $(B_{sigma_0}, B_{sigma_1}, B_{sigma_2})$.

  • line_a – Carrier line $a = [A_0 A_2]$.

  • line_b – Carrier line $b = [B_0 B_2]$.

  • apex – Intersection $O = a cap b$, or None if $a parallel b$.

  • cross_lines – Mapping (i, j) -> Line(A_i, B_j) for the 6 hexagon sides.

  • meets – Mapping "M01" | "M12" | "M20" -> Point | None for the 3 opposite meets.

  • pappus_line – Collinear Pappus line carrying the finite cross-join meets.

  • hexagon – Six-vertex Polygon if constructed.

  • type_triangles – Mapping "square" | "circle" | "diamond" -> Polygon if constructed.

  • is_collinear – Exact boolean verifying collinearity of the three cross-join meets.

model: geometor.model.Model
perm: Perm3
parity: str
a_points: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
b_points: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
b_permuted: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
line_a: sympy.geometry.Line
line_b: sympy.geometry.Line
apex: sympy.geometry.Point | None
cross_lines: dict[tuple[int, int], sympy.geometry.Line]
meets: dict[str, sympy.geometry.Point | None]
pappus_line: sympy.geometry.Line
hexagon: sympy.geometry.Polygon | None
type_triangles: dict[str, sympy.geometry.Polygon]
is_collinear: bool
class geometor.pappus.PresetConfig

Canonical exact coordinate preset for projective explorations.

Variables:
  • name – Identifier key in PRESETS.

  • title – Human-readable title of the configuration.

  • description – Mathematical and historical significance of the preset.

  • a_points – Exact coordinates of $(A_0, A_1, A_2)$ on carrier line $a$.

  • b_points – Exact coordinates of $(B_0, B_1, B_2)$ on carrier line $b$.

name: str
title: str
description: str
a_points: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
b_points: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
geometor.pappus.construct_harmonic_fourth(model: geometor.model.Model | None = None, pt_a: PointInput = (0, 0), pt_b: PointInput = (4, 0), pt_c: PointInput = (sp.Rational(4, 3), 0), *, apex: PointInput | None = None, relay: PointInput | None = None) → HarmonicFourthResult

Construct the fourth harmonic conjugate $D$ of $C$ with respect to $(A, B)$ by straightedge alone.

Executes the classical complete quadrilateral construction (already implicit in Pappus’s Synagoge Book VII harmonic lemmas):

  1. Choose an auxiliary apex $P$ not on $[A B]$ and join $[P A]$, $[P B]$, $[P C]$.

  2. Choose an auxiliary relay point $Q$ on $[P C]$ distinct from $P$ and $C$.

  3. Draw $[A Q]$ to meet $[P B]$ at $R$, and draw $[B Q]$ to meet $[P A]$ at $S$.

  4. Draw the diagonal $[R S]$; its intersection $D = [R S] cap [A B]$ satisfies $(A, B; C, D) = -1$ independently of the choices of $P$ and $Q$.

Parameters:
  • model – Optional existing Model; created if None.

  • pt_a – First base point $A$.

  • pt_b – Second base point $B$.

  • pt_c – Third collinear point $C$ (distinct from $A$, $B$, and the midpoint of $AB$).

  • apex – Optional off-line apex $P$; chosen automatically with clean exact coordinates if None.

  • relay – Optional point $Q$ on $[P C]$; defaults to the exact midpoint of $P$ and $C$.

Returns:

Populated HarmonicFourthResult.

Raises:

ValueError – If $A, B, C$ are invalid or if $C$ is the Euclidean midpoint of $AB$.

geometor.pappus.construct_pappus_configuration(model: geometor.model.Model | None = None, a_points: Sequence[PointInput] | None = None, b_points: Sequence[PointInput] | None = None, *, preset: str = 'steiner', include_apex: bool = True, discover_all_intersections: bool = False, scan_harmonics: bool = True, enable_divine: bool = False) → PappusConfigurationResult

Construct the complete $S_3$ six-permutation Pappus–Steiner configuration.

Generates all 9 cross-join lines $[A_i B_j]$, all 18 cross-join meets M{i1}{j1}{i2}{j2}, all 6 Pappus lines ($3$ even in $A_3$ and $3$ odd in $S_3 setminus A_3$), and constructs the two Steiner (Star) points:

  • \(S_+\) (ID "S1"): common concurrency point of the 3 even Pappus lines.

  • \(S_-\) (ID "S2"): common concurrency point of the 3 odd Pappus lines.

Also constructs the Steiner line \([S_+ S_-]\) when both star points are finite and distinct, and scans the resulting configuration for collinear harmonic ranges and golden sections.

Parameters:
  • model – Optional existing Model; created if None.

  • a_points – Optional sequence of 3 points on line $a$; defaults to preset.

  • b_points – Optional sequence of 3 points on line $b$; defaults to preset.

  • preset – Preset key used when a_points or b_points is None.

  • include_apex – If True and $a nparallel b$, add $O = a cap b$ to model.

  • discover_all_intersections – If True, register all pairwise intersections of carrier lines, cross-lines, and Pappus lines in model.

  • scan_harmonics – If True, populate harmonic_ranges via find_harmonic_ranges().

  • enable_divine – If True, attach geometor.divine hook and scan golden sections.

Returns:

Populated PappusConfigurationResult.

geometor.pappus.construct_pappus_hexagon(model: geometor.model.Model | None = None, a_points: Sequence[PointInput] | None = None, b_points: Sequence[PointInput] | None = None, perm: Sequence[int] = (0, 1, 2), *, preset: str = 'hexagon', include_apex: bool = True, include_hexagon: bool = True, include_type_triangles: bool = False, discover_all_intersections: bool = False) → PappusHexagonResult

Construct Pappus’s Hexagon Theorem for a single permutation $sigma in S_3$.

Given collinear triples $(A_0, A_1, A_2)$ on line $a$ and $(B_0, B_1, B_2)$ on line $b$, pairs vertices according to $sigma = (sigma_0, sigma_1, sigma_2)$ to form the hexagon $(A_0, B_{sigma_1}, A_2, B_{sigma_0}, A_1, B_{sigma_2})$ and constructs the three opposite-side cross-join meets:

  • $M_{01} = [A_0 B_{sigma_1}] cap [A_1 B_{sigma_0}]$

  • $M_{12} = [A_1 B_{sigma_2}] cap [A_2 B_{sigma_1}]$

  • $M_{20} = [A_2 B_{sigma_0}] cap [A_0 B_{sigma_2}]$

Handles both intersecting carrier lines (Synagoge VII.139) and parallel carrier lines (Synagoge VII.138), as well as configurations where one pair of opposite cross-joins is parallel (meeting on the projective line at infinity).

Parameters:
  • model – Optional existing Model; created if None.

  • a_points – Optional sequence of 3 points on line $a$; defaults to preset.

  • b_points – Optional sequence of 3 points on line $b$; defaults to preset.

  • perm – Permutation of (0, 1, 2) ordering the $B$-points.

  • preset – Preset key used when a_points or b_points is None.

  • include_apex – If True and $a nparallel b$, add $O = a cap b$ to model.

  • include_hexagon – If True, register the 6-cycle hexagon polygon in model.

  • include_type_triangles – If True, construct the square, circle, and diamond triangles reviving GEOMETOR’s pappus-3.py exploration.

  • discover_all_intersections – If True, add all remaining line-line intersections.

Returns:

Populated PappusHexagonResult.

geometor.pappus.get_preset(name: str = 'hexagon') → PresetConfig

Look up a named exact coordinate preset from PRESETS.

Parameters:

name – Preset key ("hexagon", "parallel", "steiner", "harmonic", "golden").

Returns:

Corresponding PresetConfig.

Raises:

KeyError – If name is not a known preset.

geometor.pappus.permutation_parity(perm: Sequence[int]) → str

Return "even" or "odd" for a permutation of (0, 1, 2).

Parameters:

perm – Three-element sequence permuting (0, 1, 2).

Returns:

"even" if the inversion count is even ($sigma in A_3$), else "odd".

Raises:

ValueError – If perm is not a permutation of (0, 1, 2).

geometor.pappus.verify_pappus_symbolic() → sympy.Expr

Prove Pappus’s Hexagon Theorem universally over a symbolic function field.

Parameterizes carrier line $a$ as $y = 0$ with $A_i = (a_i, 0)$ and carrier line $b$ as $y = m x + c$ with $B_j = (b_j, m b_j + c)$ over eight independent symbolic indeterminates $(a_0, a_1, a_2, b_0, b_1, b_2, m, c)$ (covering both intersecting lines $m ne 0$ and parallel lines $m = 0, c ne 0$). Computes the homogeneous coordinates of $M_{01}, M_{12}, M_{20}$ and simplifies their $3 times 3$ collinearity determinant, confirming it vanishes identically ($0$).

Returns:

Simplified determinant expression (identically sp.Integer(0)).

geometor.pappus.PASCAL_PRESETS: dict[str, PascalPresetConfig]
geometor.pappus.Cycle6
class geometor.pappus.HexagrammumMysticumCatalog

Complete projective catalog of the 60-line Hexagrammum Mysticum configuration.

Variables:
  • points – Six exact conic vertices $(P_0, dots, P_5)$.

  • chords – Mapping (i, j) -> (a, b, c) homogeneous line coordinates for all 15 chords.

  • diagonal_points – Mapping ((i, j), (k, l)) -> (X, Y, Z) for all 45 Pascal diagonal points.

  • pascal_lines – Mapping canonical_cycle -> (a, b, c) for all 60 Pascal lines.

  • steiner_points – Mapping (triangle_a, parity) -> (X, Y, Z) for all 20 Steiner points.

  • kirkman_points – Mapping (cyc_1, cyc_2, cyc_3) -> (X, Y, Z) for all 60 Kirkman points.

  • plucker_lines – Tuple of 15 homogeneous line triples each incident with 4 Steiner points.

points: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
chords: dict[tuple[int, int], HomVec3]
diagonal_points: dict[tuple[tuple[int, int], tuple[int, int]], HomVec3]
pascal_lines: dict[Cycle6, HomVec3]
steiner_points: dict[tuple[tuple[int, int, int], str], HomVec3]
kirkman_points: dict[tuple[Cycle6, Cycle6, Cycle6], HomVec3]
plucker_lines: tuple[HomVec3, ...]
class geometor.pappus.PascalHexagonResult

Structured output from construct_pascal_hexagon().

Variables:
  • model – Populated Model.

  • points – Six conic vertices $(P_0, P_1, P_2, P_3, P_4, P_5)$.

  • cycle – Active 6-cycle $(c_0, c_1, c_2, c_3, c_4, c_5)$.

  • conic – Constructed Circle or Ellipse, if registered.

  • side_lines – Six side lines in cyclic order.

  • meets – Opposite-side meets {"M03": ..., "M14": ..., "M25": ...}.

  • finite_meets – List of finite opposite-side meets.

  • pascal_line – Exact Pascal line joining the opposite-side meets.

  • hexagon – Optional inscribed 6-gon Polygon.

  • is_collinear – Exact algebraic check that all three opposite-side meets are collinear.

  • is_coconic – Exact Veronese determinant check that all six vertices lie on a conic.

model: geometor.model.Model
points: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
cycle: Cycle6
conic: sympy.geometry.Ellipse | None
side_lines: tuple[sympy.geometry.Line, sympy.geometry.Line, sympy.geometry.Line, sympy.geometry.Line, sympy.geometry.Line, sympy.geometry.Line]
meets: dict[str, sympy.geometry.Point | None]
finite_meets: list[sympy.geometry.Point]
pascal_line: sympy.geometry.Line
hexagon: sympy.geometry.Polygon | None
is_collinear: bool
is_coconic: bool
class geometor.pappus.PascalPresetConfig

Exact coordinate preset for Pascal Hexagrammum Mysticum constructions.

Variables:
  • name – Identifier key in PASCAL_PRESETS.

  • title – Human-readable preset title.

  • description – Mathematical and historical significance of the preset.

  • points – Six exact points $(P_0, P_1, P_2, P_3, P_4, P_5)$ on the conic.

  • default_cycle – Default cyclic ordering of vertex indices 0..5.

  • center – Conic center $(x_0, y_0)$ for circle/ellipse rendering.

  • rx – Horizontal semi-axis $a$ of the carrier circle/ellipse.

  • ry – Vertical semi-axis $b$ of the carrier circle/ellipse.

name: str
title: str
description: str
points: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
default_cycle: Cycle6
center: sympy.geometry.Point
rx: sympy.Expr
ry: sympy.Expr
class geometor.pappus.PascalSteinerFamilyResult

Structured output from construct_pascal_steiner_family().

Variables:
  • model – Populated Model.

  • points – Six conic vertices $(P_0, dots, P_5)$.

  • triangle_a – Vertex indices $(a_0, a_1, a_2)$ of the first inscribed triangle.

  • triangle_b – Vertex indices $(b_0, b_1, b_2)$ of the complementary inscribed triangle.

  • conic – Constructed circle or ellipse carrier curve.

  • chords – Mapping (a_i, b_j) -> Line for the 9 cross-chords.

  • pascal_lines – Mapping perm -> Line for all 6 \(S_3\) alternating hexagons.

  • even_pascal_lines – Tuple of the 3 even (\(A_3\)) Pascal lines.

  • odd_pascal_lines – Tuple of the 3 odd (\(S_3 \setminus A_3\)) Pascal lines.

  • steiner_even – Even Steiner concurrency point \(G_+\) (ID "S1"), if finite.

  • steiner_odd – Odd Steiner concurrency point \(G_-\) (ID "S2"), if finite.

  • steiner_line – Line \([G_+ G_-]\) joining the two Steiner points, if finite.

  • harmonic_ranges – Discovered collinear harmonic tetrads.

  • golden_sections – Discovered golden sections.

model: geometor.model.Model
points: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
triangle_a: tuple[int, int, int]
triangle_b: tuple[int, int, int]
conic: sympy.geometry.Ellipse | None
chords: dict[tuple[int, int], sympy.geometry.Line]
pascal_lines: dict[geometor.pappus.constructions.Perm3, sympy.geometry.Line]
even_pascal_lines: tuple[sympy.geometry.Line, sympy.geometry.Line, sympy.geometry.Line]
odd_pascal_lines: tuple[sympy.geometry.Line, sympy.geometry.Line, sympy.geometry.Line]
steiner_even: sympy.geometry.Point | None
steiner_odd: sympy.geometry.Point | None
steiner_line: sympy.geometry.Line | None
harmonic_ranges: list[geometor.pappus.projective.HarmonicRange]
golden_sections: list[geometor.pappus.projective.GoldenRange]
geometor.pappus.canonical_hexagon_cycle(cycle: Sequence[int]) → Cycle6

Normalize a 6-vertex permutation up to dihedral rotation and reversal ($D_6$).

Rotates cycle so 0 appears first and picks the lexicographically smaller orientation between (0, c1, c2, c3, c4, c5) and (0, c5, c4, c3, c2, c1).

Parameters:

cycle – Permutation of (0, 1, 2, 3, 4, 5).

Returns:

Canonical 6-tuple representative among the $6! / 12 = 60$ distinct hexagons.

Raises:

ValueError – If cycle is not a permutation of 0..5.

geometor.pappus.construct_pascal_hexagon(model: geometor.model.Model | None = None, points: Sequence[PointInput] | None = None, cycle: Sequence[int] | None = None, *, preset: str = 'hexagrammum', include_conic: bool = True, include_hexagon: bool = True, enable_divine: bool = False) → PascalHexagonResult

Construct Blaise Pascal’s Hexagrammum Mysticum for six points on a conic.

Parameters:
  • model – Optional existing Model; created if None.

  • points – Optional sequence of 6 coconic points; defaults to preset.

  • cycle – Optional cyclic ordering of 0..5; defaults to the preset’s default_cycle.

  • preset – Key in PASCAL_PRESETS used when points is None.

  • include_conic – If True and carrier circle/ellipse parameters are known, register the conic.

  • include_hexagon – If True, register the 6-gon polygon < P_c0 ... P_c5 >.

  • enable_divine – If True, attach geometor.divine golden section hook.

Returns:

Populated PascalHexagonResult.

Raises:

ValueError – If fewer/more than 6 distinct coconic points are provided or if two or more opposite-side pairs are parallel.

geometor.pappus.construct_pascal_steiner_family(model: geometor.model.Model | None = None, points: Sequence[PointInput] | None = None, *, preset: str = 'hexagrammum', triangle_a: tuple[int, int, int] = (0, 2, 4), triangle_b: tuple[int, int, int] = (1, 3, 5), include_conic: bool = True, scan_harmonics: bool = True, enable_divine: bool = False) → PascalSteinerFamilyResult

Construct the 6-hexagon \(S_3\) bi-triangle Pascal family and its two Steiner points.

Partitions the 6 conic vertices into $triangle_A = (P_{a_0}, P_{a_1}, P_{a_2})$ and $triangle_B = (P_{b_0}, P_{b_1}, P_{b_2})$. Permuting $triangle_B$ by $sigma in S_3$ forms 6 alternating hexagons $langle A_0, B_{sigma_0}, A_1, B_{sigma_1}, A_2, B_{sigma_2} rangle$ whose 3 even (\(A_3\)) Pascal lines concur at \(G_+\) (ID "S1") and whose 3 odd (\(S_3 \setminus A_3\)) Pascal lines concur at \(G_-\) (ID "S2").

Parameters:
  • model – Optional existing Model.

  • points – Optional sequence of 6 coconic points; defaults to preset.

  • preset – Key in PASCAL_PRESETS used when points is None.

  • triangle_a – Indices $(a_0, a_1, a_2)$ of the first inscribed triangle.

  • triangle_b – Complementary indices $(b_0, b_1, b_2)$ of the second triangle.

  • include_conic – If True, register the carrier circle or ellipse.

  • scan_harmonics – If True, scan the configuration for collinear harmonic tetrads.

  • enable_divine – If True, attach geometor.divine and scan golden sections.

Returns:

Populated PascalSteinerFamilyResult.

Raises:

ValueError – If triangle_a and triangle_b do not partition 0..5 or points are not coconic.

geometor.pappus.enumerate_hexagrammum_mysticum(points: Sequence[PointInput] | None = None, *, preset: str = 'hexagrammum') → HexagrammumMysticumCatalog

Enumerate and verify the complete 60-line Hexagrammum Mysticum web in $mathbb{P}^2$.

Computes in exact homogeneous coordinates:

  1. 15 Chords $[P_i P_j]$ ($0 le i < j le 5$).

  2. 45 Diagonal Pascal Points $[P_i P_j] cap [P_k P_l]$ on disjoint vertex pairs.

  3. 60 Pascal Lines across all $6! / 12 = 60$ cyclic hexagons, verifying 3-point collinearity.

  4. 20 Jakob Steiner Points ($10$ triangle partitions $times 2$ \(S_3\) parities), verifying 3-line concurrency at each point.

  5. 60 Thomas Kirkman Points, verifying 3-line concurrency on each syntheme Kirkman triple.

  6. 15 Julius Plücker Lines, each carrying 4 of the 20 Steiner points.

Parameters:
  • points – Optional sequence of 6 coconic points; defaults to preset.

  • preset – Key in PASCAL_PRESETS used when points is None.

Returns:

Populated HexagrammumMysticumCatalog.

Raises:

ValueError – If fewer/more than 6 distinct coconic points are given.

geometor.pappus.get_pascal_preset(name: str) → PascalPresetConfig

Look up a named Pascal preset in PASCAL_PRESETS.

Parameters:

name – Preset key ("hexagrammum", "convex", "ellipse", or "golden_conic").

Returns:

Matching PascalPresetConfig.

Raises:

KeyError – If name is unknown.

geometor.pappus.verify_pascal_symbolic() → sympy.Expr

Prove Pascal’s Hexagrammum Mysticum universally over $mathbb{Z}[t_0, t_1, t_2, t_3, t_4, t_5]$.

Parameterizes six generic points on the projective conic $X^2 + Y^2 = Z^2$ via $P_k = [1 - t_k^2 : 2 t_k : 1 + t_k^2]$, computes the three opposite-side meets $M_{03}, M_{14}, M_{25}$ via 3D vector cross products, and expands the $3 times 3$ collinearity determinant $det[M_{03}, M_{14}, M_{25}]$, returning 0 identically.

Returns:

Simplified SymPy polynomial expression (identically sp.Integer(0)).

geometor.pappus.PHI: sympy.Expr
class geometor.pappus.GoldenRange

Represents three ordered collinear points dividing a segment in the Golden Ratio $phi$.

Variables:
  • section – Underlying Section object.

  • point_ids – Ordered model IDs $(P_1, P_2, P_3)$ of the three points.

  • line – Carrier line in the model, if associated with one.

  • line_id – Model ID of the carrier line.

  • ratio – Exact symbolic ratio of longer to shorter segment ($phi$).

section: geometor.model.sections.Section
point_ids: tuple[str, str, str]
line: sympy.geometry.Line | None
line_id: str
ratio: sympy.Expr
class geometor.pappus.HarmonicRange

Represents four ordered collinear points forming a harmonic range $(P_1, P_3; P_2, P_4) = -1$.

Variables:
  • points – Ordered tuple $(P_1, P_2, P_3, P_4)$ along the carrier line such that $(P_1, P_3)$ and $(P_2, P_4)$ harmonically separate each other.

  • point_ids – Corresponding model IDs of the four points.

  • line – Carrier line in the model, if associated with one.

  • line_id – Model ID of the carrier line.

  • value – Exact symbolic cross-ratio $(P_1, P_3; P_2, P_4) = -1$.

points: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
point_ids: tuple[str, str, str, str]
line: sympy.geometry.Line | None
line_id: str
value: sympy.Expr
geometor.pappus.anharmonic_orbit(lam: sympy.Expr) → list[sympy.Expr]

Return the six cross-ratio values generated by permuting four collinear points.

Parameters:

lam – Fundamental cross-ratio $lambda = (A, B; C, D) notin {0, 1}$.

Returns:

List of the 6 simplified expressions $[lambda, 1/lambda, 1 - lambda, 1/(1 - lambda), (lambda - 1)/lambda, lambda/(lambda - 1)]$.

geometor.pappus.are_coconic(points: Sequence[sympy.geometry.Point | tuple[sympy.Expr | int, sympy.Expr | int]]) → bool

Return True iff all given points lie on a single conic (smooth or degenerate line-pair).

Unifies Pappus’s degenerate two-line configuration ($L_a cdot L_b = 0$) and Pascal’s smooth conic configuration ($A x^2 + B x y + C y^2 + D x + E y + F = 0$) via the rank of the $N times 6$ Veronese matrix $[x_k^2, x_k y_k, y_k^2, x_k, y_k, 1]$.

Parameters:

points – Sequence of planar points (any $le 5$ points trivially lie on at least one conic).

Returns:

True if the Veronese matrix has rank $le 5$, else False.

geometor.pappus.circle_stereographic_point(t: sympy.Expr | int, *, center: sympy.geometry.Point | tuple[sympy.Expr | int, sympy.Expr | int] = (0, 0), radius: sympy.Expr | int = 1) → sympy.geometry.Point

Compute an exact point on $(x - x_0)^2 + (y - y_0)^2 = R^2$ via rational stereographic slope $t$.

Uses the classical Weierstrass / stereographic parameterization from $(-R + x_0, y_0)$:

\[P(t) = \left(x_0 + R \frac{1 - t^2}{1 + t^2},\; y_0 + R \frac{2 t}{1 + t^2}\right).\]

Every $t in mathbb{Q}$ yields an exact rational point in $mathbb{Q}^2$, and every $t in mathbb{Q}(phi)$ yields an exact point in $mathbb{Q}(sqrt{5})^2$.

Parameters:
  • t – Exact symbolic or integer stereographic parameter.

  • center – Circle center $(x_0, y_0)$.

  • radius – Exact positive circle radius $R$.

Returns:

Exact Point on the circle.

geometor.pappus.conic_cross_ratio(p1: sympy.geometry.Point, p2: sympy.geometry.Point, p3: sympy.geometry.Point, p4: sympy.geometry.Point, observer: sympy.geometry.Point) → sympy.Expr

Compute Michel Chasles’s projective cross-ratio $(P_1, P_2; P_3, P_4)_{mathcal{C}}$ on a conic.

By Chasles’s Theorem, for four distinct points $P_1, P_2, P_3, P_4$ on an irreducible conic $mathcal{C}$, the cross-ratio of the pencil of four rays $[V P_1], [V P_2], [V P_3], [V P_4]$ cut by any transversal line is independent of the fifth point $V = text{observer} in mathcal{C}$.

Parameters:
  • p1 – First conic point.

  • p2 – Second conic point.

  • p3 – Third conic point.

  • p4 – Fourth conic point.

  • observer – Distinct fifth point $V$ on the same conic.

Returns:

Exact simplified SymPy cross-ratio expression (or sp.oo).

Raises:

ValueError – If the 5 points are not distinct or not coconic.

geometor.pappus.conic_equation_through_points(points: Sequence[sympy.geometry.Point | tuple[sympy.Expr | int, sympy.Expr | int]]) → sympy.Expr

Construct the exact quadratic conic polynomial $C(x, y)$ through five points.

Evaluates the $6 times 6$ Veronese determinant

\[\begin{split}\det \begin{bmatrix} x^2 & x y & y^2 & x & y & 1 \\ x_0^2 & x_0 y_0 & y_0^2 & x_0 & y_0 & 1 \\ \vdots & \vdots & \vdots & \vdots & \vdots & \vdots \\ x_4^2 & x_4 y_4 & y_4^2 & x_4 & y_4 & 1 \end{bmatrix}\end{split}\]

in the symbols x, y.

Parameters:

points – Sequence of 5 points in the plane.

Returns:

Expanded SymPy polynomial in x and y (zero iff the 5 points are degenerate with 4+ collinear in a way that fails to determine a unique conic).

Raises:

ValueError – If len(points) != 5.

geometor.pappus.cross_ratio(pt_a: sympy.geometry.Point, pt_b: sympy.geometry.Point, pt_c: sympy.geometry.Point, pt_d: sympy.geometry.Point, *, check_collinear: bool = True) → sympy.Expr

Compute the exact projective cross-ratio $(A, B; C, D)$ of four collinear points.

Uses the standard projective convention

\[(A, B; C, D) = \frac{(u_A - u_C)(u_B - u_D)}{(u_A - u_D)(u_B - u_C)},\]

where $u$ is any affine coordinate along the line carrying $A, B, C, D$. Under this convention, $(A, B; C, D) = -1$ iff $(C, D)$ harmonically separates $(A, B)$, and $(0, 1; phi, phi + 1) = phi$.

Parameters:
  • pt_a – First point $A$.

  • pt_b – Second point $B$.

  • pt_c – Third point $C$.

  • pt_d – Fourth point $D$.

  • check_collinear – If True, verify that $A, B, C, D$ are collinear.

Returns:

Exact simplified SymPy expression for $(A, B; C, D)$.

Raises:

ValueError – If the points are not collinear or if the denominator vanishes.

geometor.pappus.enable_divine_analysis(model: geometor.model.Model) → geometor.model.Model

Attach geometor.divine.register_divine_hook() to model and return it.

Parameters:

model – Target Model instance.

Returns:

The same model with real-time golden section analysis enabled.

geometor.pappus.exact_line_meet(line_1: sympy.geometry.Line, line_2: sympy.geometry.Line) → sympy.geometry.Point | None

Compute the exact intersection of two lines via Cramer’s rule.

Returns None when the two lines are parallel or coincident (meeting at the projective line at infinity).

Parameters:
  • line_1 – First SymPy line.

  • line_2 – Second SymPy line.

Returns:

Exact intersection sympy.geometry.point.Point, or None if parallel.

geometor.pappus.find_golden_sections(model: geometor.model.Model, *, register_sections: bool = False, include_guides: bool = False) → list[GoldenRange]

Scan all lines in a Model for exact Golden Ratio sections.

Complements geometor.divine.register_divine_hook() (which checks parent lines incrementally as intersection points are added) with a comprehensive post-construction scan across all points lying on each line in model.

Parameters:
  • model – Geometric model to scan.

  • register_sections – If True, also add each discovered golden Section to model with classes=["golden"].

  • include_guides – If True, include guide points and lines.

Returns:

List of discovered GoldenRange records.

geometor.pappus.find_harmonic_ranges(model: geometor.model.Model, line: sympy.geometry.Line | None = None, *, include_guides: bool = False) → list[HarmonicRange]

Scan lines in a Model for exact collinear harmonic tetrads.

Revives and modernizes the analyze_harmonics routine from GEOMETOR’s original 2023 pappus.py exploration. For every candidate line carrying at least four points, points are sorted along the line ($P_1 < P_2 < P_3 < P_4$) so that each unordered harmonic tetrad is reported canonically once via the unique alternating separation $(P_1, P_3; P_2, P_4) = -1$.

Parameters:
  • model – Geometric model to scan.

  • line – Optional single line to inspect; if None, scans all lines in model.

  • include_guides – If True, also include points and lines marked guide=True.

Returns:

List of discovered HarmonicRange records.

geometor.pappus.harmonic_conjugate_point(pt_a: sympy.geometry.Point, pt_b: sympy.geometry.Point, pt_c: sympy.geometry.Point) → sympy.geometry.Point

Compute the exact algebraic fourth harmonic point $D$ such that $(A, B; C, D) = -1$.

Solves $(A, B; C, D) = -1$ along line $[A B]$ in closed symbolic form. For the pure straightedge geometric construction via a complete quadrilateral, see geometor.pappus.constructions.construct_harmonic_fourth().

Parameters:
  • pt_a – First base point $A$.

  • pt_b – Second base point $B$.

  • pt_c – Given third collinear point $C$ (not the midpoint of $A$ and $B$).

Returns:

Exact sympy.geometry.point.Point $D$ satisfying $(A, B; C, D) = -1$.

Raises:

ValueError – If $A, B, C$ are not distinct collinear points or $C$ is the midpoint of $AB$ (in which case $D$ lies on the line at infinity).

geometor.pappus.is_harmonic_range(pt_a: sympy.geometry.Point, pt_b: sympy.geometry.Point, pt_c: sympy.geometry.Point, pt_d: sympy.geometry.Point) → bool

Determine whether $(A, B; C, D) = -1$ in exact symbolic arithmetic.

Parameters:
  • pt_a – First base point $A$.

  • pt_b – Second base point $B$.

  • pt_c – First conjugate point $C$.

  • pt_d – Second conjugate point $D$.

Returns:

True iff $A, B, C, D$ are distinct collinear points satisfying $(A, B; C, D) = -1$.

geometor.pappus.line_spread(line_1: sympy.geometry.Line, line_2: sympy.geometry.Line) → sympy.Expr

Compute the exact rational-trigonometric spread $s(ell_1, ell_2) = sin^2theta$.

Parameters:
  • line_1 – First line $a_1 x + b_1 y + c_1 = 0$.

  • line_2 – Second line $a_2 x + b_2 y + c_2 = 0$.

Returns:

Exact symbolic spread in $[0, 1]$ (equals $0$ iff parallel, $1$ iff perpendicular).

geometor.pappus.project_point(center: sympy.geometry.Point, target_line: sympy.geometry.Line, pt: sympy.geometry.Point) → sympy.geometry.Point

Project a point from a perspective center onto a target line.

Implements central perspectivity as studied by Pappus in Synagoge Book VII, Proposition 129.

Parameters:
  • center – Center of perspectivity $O$ not lying on target_line.

  • target_line – Destination line onto which pt is projected.

  • pt – Source point $P ne O$.

Returns:

Exact intersection $[O P] cap text{target_line}$.

Raises:

ValueError – If pt coincides with center or $[O P]$ is parallel to target_line.

geometor.pappus.quadrance(pt_1: sympy.geometry.Point, pt_2: sympy.geometry.Point) → sympy.Expr

Compute the exact rational-trigonometric quadrance $Q(P_1, P_2)$.

Parameters:
  • pt_1 – First point.

  • pt_2 – Second point.

Returns:

Simplified symbolic expression $(x_2 - x_1)^2 + (y_2 - y_1)^2$.

geometor.pappus.EMBEDDED_SVG_STYLE: str = ''
geometor.pappus.export_svg(model: geometor.model.Model, output_path: str | pathlib.Path, *, graphic_id: str = 'g1', title: str = 'Pappus Projective Construction', width: int = 680, height: int = 440, margin: float = 44.0, bbox: tuple[float, float, float, float] | None = None, focus_points: Sequence[sympy.geometry.Point] | None = None, include_guides: bool = False, show_labels: bool = True, show_meet_labels: bool = True, show_aux_labels: bool = False, label_overrides: dict[str, tuple[str, str]] | None = None, highlight_point_ids: Sequence[str] | None = None) → pathlib.Path

Write an interactive SVG rendering of model to output_path.

Parameters:
  • model – Populated Model.

  • output_path – Destination .svg file path (parent directories created automatically).

  • graphic_id – data-graphic-id identifier for geometor_interactive.js.

  • title – Accessible SVG title string.

  • width – Pixel width of the SVG viewBox.

  • height – Pixel height of the SVG viewBox.

  • margin – Outer pixel margin around the framed point cloud.

  • bbox – Optional explicit math viewport (xmin, xmax, ymin, ymax).

  • focus_points – Optional subset of points used to compute auto-framing bounds.

  • include_guides – If True, also render elements marked guide=True.

  • show_labels – Master toggle for point text labels.

  • show_meet_labels – If False, suppress text labels on M... cross-join meets.

  • show_aux_labels – If True, also label auto-discovered X1..Xn intersections.

  • label_overrides – Optional mapping pt_id -> (base, subscript).

  • highlight_point_ids – Optional point IDs to emphasize with an extra halo ring.

Returns:

Resolved Path of the written SVG file.

geometor.pappus.render_svg_string(model: geometor.model.Model, *, graphic_id: str = 'g1', title: str = 'Pappus Projective Construction', width: int = 680, height: int = 440, margin: float = 44.0, bbox: tuple[float, float, float, float] | None = None, focus_points: Sequence[sympy.geometry.Point] | None = None, include_guides: bool = False, show_labels: bool = True, show_meet_labels: bool = True, show_aux_labels: bool = False, label_overrides: dict[str, tuple[str, str]] | None = None, highlight_point_ids: Sequence[str] | None = None) → str

Render a Model into a complete interactive SVG string.

Parameters:
  • model – Populated Model.

  • graphic_id – data-graphic-id identifier for geometor_interactive.js.

  • title – Accessible SVG title string.

  • width – Pixel width of the SVG viewBox.

  • height – Pixel height of the SVG viewBox.

  • margin – Outer pixel margin around the framed point cloud.

  • bbox – Optional explicit math viewport (xmin, xmax, ymin, ymax).

  • focus_points – Optional subset of points used to compute auto-framing bounds.

  • include_guides – If True, also render elements marked guide=True.

  • show_labels – Master toggle for point text labels.

  • show_meet_labels – If False, suppress text labels on M... cross-join meets (useful on dense 18-meet composite diagrams while retaining hover refs).

  • show_aux_labels – If True, also label auto-discovered X1..Xn intersections.

  • label_overrides – Optional mapping pt_id -> (base, subscript).

  • highlight_point_ids – Optional point IDs to emphasize with an extra halo ring.

Returns:

UTF-8 XML/SVG string.

class geometor.pappus.ArbelosChainResult

Exact symbolic result for Pappus’s Ancient Proposition on the Arbelos (Synagoge IV.14–18).

Variables:
  • model – Populated Model.

  • r1 – Radius of left inner semicircle $C_{mathrm{left}}$ on $AD$.

  • r2 – Radius of right inner semicircle $C_{mathrm{right}}$ on $DC$.

  • outer_radius – Outer semicircle radius $R = r_1 + r_2$ on $AC$.

  • outer_circle – Carrier circle on diameter $AC$.

  • left_circle – Left inner circle on diameter $AD$.

  • right_circle – Right inner circle on diameter $DC$ ($n = 0$ base of chain).

  • chain – Tuple of ArbelosCircle entries for $n = 1, dots, text{count}$.

  • locus_ellipse – Exact ellipse with foci $(O_1, O_0)$ carrying all centers $K_n$.

model: geometor.model.Model
r1: sympy.Expr
r2: sympy.Expr
outer_radius: sympy.Expr
outer_circle: sympy.geometry.Circle
left_circle: sympy.geometry.Circle
right_circle: sympy.geometry.Circle
chain: tuple[ArbelosCircle, ...]
locus_ellipse: sympy.geometry.Ellipse
class geometor.pappus.ArbelosCircle

Exact symbolic record for the $n$-th tangent circle in Pappus’s Arbelos chain.

Variables:
  • index – Chain index $n ge 1$ ($n = 1$ rests on the baseline semicircle $C_{mathrm{right}}$).

  • center – Exact rational center $K_n = (x_n, y_n)$.

  • radius – Exact rational radius $r_n$.

  • diameter – Exact rational diameter $d_n = 2 r_n$.

  • height – Exact center altitude $y_n$ above baseline $AC$.

  • height_over_diameter – Exact simplified ratio $y_n / d_n = n$.

  • circle – Registered sympy.geometry.Circle in the model.

  • foot – Projection foot $P_n = (x_n, 0)$ on baseline $AC$.

index: int
center: sympy.geometry.Point
radius: sympy.Expr
diameter: sympy.Expr
height: sympy.Expr
height_over_diameter: sympy.Expr
circle: sympy.geometry.Circle
foot: sympy.geometry.Point
class geometor.pappus.HoneycombIsoperimetryResult

Exact symbolic result for Book V’s Honeycomb Isoperimetry & Book VIII’s 7-Hexagon Cluster.

Variables:
  • perimeter – Common perimeter $P > 0$ shared by the equilateral triangle, square, and hexagon.

  • tiling_polygons – Tuple (3, 4, 6) of the unique regular $n$-gons tiling the plane.

  • interior_angles_deg – Exact interior angles {3: 60, 4: 90, 6: 120} in degrees.

  • polygons_per_vertex – Exact valence {3: 6, 4: 4, 6: 3} meeting around each vertex.

  • side_lengths – Exact side lengths {3: P/3, 4: P/4, 6: P/6}.

  • areas – Exact symbolic areas {3: Area_3, 4: Area_4, 6: Area_6}.

  • area_hex_over_tri – Exact rational ratio $operatorname{Area}_6 / operatorname{Area}_3 = 3/2$.

  • area_hex_over_sq – Exact radical ratio $operatorname{Area}_6 / operatorname{Area}_4 = 2sqrt{3}/3$.

  • area_sq_over_tri – Exact radical ratio $operatorname{Area}_4 / operatorname{Area}_3 = 9sqrt{3}/16$.

  • circumradius_seven_hexagons – Exact circumradius $R_7 = s_6 sqrt{7}$ of the 7-hexagon cluster (Synagoge VIII.23).

  • model – Optional populated Model when constructed geometrically.

perimeter: sympy.Expr
tiling_polygons: tuple[int, int, int]
interior_angles_deg: dict[int, sympy.Expr]
polygons_per_vertex: dict[int, int]
side_lengths: dict[int, sympy.Expr]
areas: dict[int, sympy.Expr]
area_hex_over_tri: sympy.Expr
area_hex_over_sq: sympy.Expr
area_sq_over_tri: sympy.Expr
circumradius_seven_hexagons: sympy.Expr
model: geometor.model.Model | None = None
class geometor.pappus.PappusAreaResult

Exact symbolic result for Pappus’s Area Theorem (Synagoge Book IV, Prop. 1).

Variables:
  • model – Populated Model.

  • preset – Preset identifier ("scalene", "pythagoras", or "custom").

  • triangle – Tuple $(A, B, C)$ of counter-clockwise triangle vertices.

  • parallelogram_ab – Tuple $(A, B, D, E)$ of outward parallelogram on $AB$.

  • parallelogram_ac – Tuple $(A, C, F, G)$ of outward parallelogram on $AC$.

  • parallelogram_bc – Tuple $(B, C, M, L)$ of translated parallelogram on $BC$.

  • apex_h – Meet $H = [DE] cap [FG]$ of the two outer parallelogram sides.

  • ridge_j – Meet $J = [HA] cap [BC]$ dividing $BCML$ into two sub-parallelograms.

  • area_ab – Exact positive area of parallelogram $ABDE$.

  • area_ac – Exact positive area of parallelogram $ACFG$.

  • area_bc – Exact positive area of parallelogram $BCML$.

  • area_residual – Exact simplified difference $operatorname{Area}(BCML) - (operatorname{Area}(ABDE) + operatorname{Area}(ACFG)) = 0$.

model: geometor.model.Model
preset: str
triangle: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
parallelogram_ab: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
parallelogram_ac: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
parallelogram_bc: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
apex_h: sympy.geometry.Point
ridge_j: sympy.geometry.Point
area_ab: sympy.Expr
area_ac: sympy.Expr
area_bc: sympy.Expr
area_residual: sympy.Expr
class geometor.pappus.ThreeMeansResult

Exact symbolic result for Pappus’s semicircle construction of the three means.

Variables:
  • model – Populated Model.

  • a – First positive segment length $AD = a$.

  • b – Second positive segment length $DC = b$.

  • arithmetic_mean – Exact arithmetic mean \(A = \frac{a + b}{2} = |OB|\).

  • geometric_mean – Exact geometric mean \(G = \sqrt{ab} = |DB|\).

  • harmonic_mean – Exact harmonic mean \(H = \frac{2ab}{a + b} = |BF|\).

  • point_a – Left diameter endpoint $A = (0, 0)$.

  • point_d – Interior division point $D = (a, 0)$.

  • point_c – Right diameter endpoint $C = (a + b, 0)$.

  • center_o – Semicircle center $O = left(frac{a + b}{2}, 0right)$.

  • point_b – Semicircle ordinate apex $B = (a, sqrt{ab})$.

  • point_f – Perpendicular foot $F$ from $D$ onto radius $OB$.

  • tangent_t – Optional harmonic conjugate $T$ where tangent at $B$ meets $AC$ (when $a ne b$), satisfying $(A, C; D, T) = -1$.

  • semicircle – Carrier circle $(O, A)$ of radius $R = frac{a + b}{2}$.

  • harmonic_cross_ratio – Exact cross-ratio $(A, C; D, T) = -1$ when $T$ is finite.

model: geometor.model.Model
a: sympy.Expr
b: sympy.Expr
arithmetic_mean: sympy.Expr
geometric_mean: sympy.Expr
harmonic_mean: sympy.Expr
point_a: sympy.geometry.Point
point_d: sympy.geometry.Point
point_c: sympy.geometry.Point
center_o: sympy.geometry.Point
point_b: sympy.geometry.Point
point_f: sympy.geometry.Point
tangent_t: sympy.geometry.Point | None
semicircle: sympy.geometry.Circle
harmonic_cross_ratio: sympy.Expr | None

Generate publication-grade interactive .euclid-graphic SVGs for the Synagoge Codex.

Exports six standalone theme-adaptive SVGs covering Books III, IV, V, and VIII:

  1. synagoge_three_means.svg — Rational $(9, 16)$ semicircle means ($A = 25/2, G = 12, H = 288/25$) plus harmonic conjugate $T$.

  2. synagoge_three_means_golden.svg — Golden $(1, phi^2)$ semicircle means ($G = phi$) in $mathbb{Q}(phi)$.

  3. pappus_area_theorem.svg — General scalene Pappus Area Theorem (Synagoge IV.1).

  4. pappus_area_pythagoras.svg — Right-triangle + squares specialization (Elements I.47).

  5. pappus_arbelos_chain.svg — Rational Arbelos tangent circle chain (Synagoge IV.14–18).

  6. honeycomb_isoperimetry.svg — Equal-perimeter $n in {3, 4, 6}$ comparison & 7-cell honeycomb rosette inscribed in $(H_0, N)$ (Synagoge V.1 & VIII.23).

Parameters:

output_dir – Destination directory for .svg files.

Returns:

List of resolved Path objects written.

geometor.pappus.construct_honeycomb_isoperimetry(perimeter: ScalarInput = 12, *, model: geometor.model.Model | None = None) → geometor.model.Model

Construct an exact Model for Book V’s Honeycomb & Book VIII.23’s 7-Hexagon Circle.

Builds:

  1. Left Comparison Row: Equilateral triangle ($s_3 = P/3$), square ($s_4 = P/4$), and regular hexagon ($s_6 = P/6$) sharing exact perimeter $P$.

  2. Right 7-Cell Honeycomb Rosette: Central regular hexagon $H_0$ of side $s_6$ surrounded by six congruent regular hexagons sharing every wall without interstices, inscribed inside the exact outer circle of radius $R = s_6 sqrt{7}$ proved in Synagoge Book VIII, Prop. 23 (Hultsch III, pp. 1096–1102).

Parameters:
  • perimeter – Common perimeter $P$ (default 12, giving $s_3 = 4, s_4 = 3, s_6 = 2$).

  • model – Optional existing Model.

Returns:

Populated Model.

geometor.pappus.construct_pappus_arbelos_chain(model_or_r1: geometor.model.Model | ScalarInput = 2, r1_or_r2: ScalarInput = 1, r2_or_count: ScalarInput | int = 4, count: int | None = None, *, model: geometor.model.Model | None = None) → ArbelosChainResult

Construct Pappus’s Arbelos tangent circle chain (Synagoge IV.14–18, Hultsch I, pp. 208–227).

Supports both construct_pappus_arbelos_chain(r1=2, r2=1, count=4, *, model=None) and construct_pappus_arbelos_chain(model, r1, r2, count=4).

For inner semicircle radii $r_1, r_2 > 0$ and outer radius $R = r_1 + r_2$ along baseline $AC$ ($A = (0, 0)$, $D = (2r_1, 0)$, $C = (2R, 0)$), circle inversion centered at $A$ with squared radius $k^2 = 4 R r_1$ maps $C_{mathrm{outer}}$ and $C_{mathrm{left}}$ to the parallel vertical lines $u = 2r_1$ and $u = 2R$, yielding 100% rational coordinates for every circle $C_n$ ($n ge 1$) with zero square roots:

\[\Delta_n = r_1(r_1 + r_2) + n^2 r_2^2, \qquad r_n = \frac{r_1 r_2 (r_1 + r_2)}{\Delta_n},\]
\[x_n = \frac{r_1 (r_1 + r_2)(2r_1 + r_2)}{\Delta_n}, \qquad y_n = \frac{2 n \, r_1 r_2 (r_1 + r_2)}{\Delta_n} = 2 n r_n = n d_n.\]
Parameters:
  • model_or_r1 – Either a Model or left inner radius $r_1$.

  • r1_or_r2 – Left radius $r_1$ (when model_or_r1 is a Model) or right radius $r_2$.

  • r2_or_count – Right radius $r_2$ (when model_or_r1 is a Model) or chain length count.

  • count – Number of chain circles $n = 1, dots, text{count}$ when model_or_r1 is a Model.

  • model – Optional explicit Model keyword argument.

Returns:

Populated ArbelosChainResult.

geometor.pappus.construct_pappus_area_theorem(model: geometor.model.Model | None = None, *, preset: str = 'scalene', triangle: tuple[PointInput, PointInput, PointInput] | None = None, vec_ab: PointInput | None = None, vec_ac: PointInput | None = None) → PappusAreaResult

Construct Pappus’s Area Theorem (Synagoge Book IV, Prop. 1, Hultsch I, pp. 176–179).

Given an arbitrary counter-clockwise triangle $triangle ABC$ and two arbitrary outward parallelograms $ABDE$ (with $D = B + vec{u}$, $E = A + vec{u}$) and $ACFG$ (with $F = C + vec{v}$, $G = A + vec{v}$):

  1. Extend outer sides $[DE]$ and $[FG]$ to meet at $H$.

  2. Join $[HA]$ and extend it across base $[BC]$ to meet $[BC]$ at $J$.

  3. Translate segment $HA$ to $BL$ and $CM$ ($L = B + (A - H)$, $M = C + (A - H)$) forming outward parallelogram $BCML$ on base $BC$.

  4. By shear-invariance through parallels $[DE] parallel [AB]$, $[FG] parallel [AC]$, and $[HA] parallel [BL] parallel [CM]$:

    \[\operatorname{Area}(ABDE) = \operatorname{Area}(ABLH\text{-shear}) = \operatorname{Area}(BLNJ), \quad \operatorname{Area}(ACFG) = \operatorname{Area}(JCMN),\]

    whence $operatorname{Area}(BCML) = operatorname{Area}(ABDE) + operatorname{Area}(ACFG)$.

Presets:
  • "scalene": Oblique scalene $triangle ABC$ with $A = (3, 4)$, $B = (0, 0)$, $C = (7, 0)$ and skewed non-rectangular parallelograms of areas $13$ and $15$, yielding $operatorname{Area}(BCML) = 28$.

  • "pythagoras": Exact $3$-$4$-$5$ right triangle at apex $A = left(frac{9}{5}, frac{12}{5}right)$ on hypotenuse $B = (0, 0)$, $C = (5, 0)$ with squares of areas $9$ and $16$, yielding the exact $5 times 5$ hypotenuse square of area $25$ (Elements I.47).

Parameters:
  • model – Optional Model; created if None.

  • preset – "scalene" or "pythagoras" when triangle is None.

  • triangle – Optional custom (A, B, C) counter-clockwise vertices.

  • vec_ab – Optional outward side vector $vec{u}$ for parallelogram $ABDE$.

  • vec_ac – Optional outward side vector $vec{v}$ for parallelogram $ACFG$.

Returns:

Populated PappusAreaResult.

geometor.pappus.construct_three_means(model_or_a: geometor.model.Model | ScalarInput = 9, a_or_b: ScalarInput = 16, b: ScalarInput | None = None, *, model: geometor.model.Model | None = None, include_harmonic_tangent: bool = True) → ThreeMeansResult

Construct Pappus’s semicircle diagram exhibiting the three classical means (Synagoge III.5–16).

Supports both construct_three_means(a, b, *, model=None) and construct_three_means(model, a, b).

On diameter $AC = a + b$ with center $O = left(frac{a+b}{2}, 0right)$ and interior point $D = (a, 0)$:

  • Erect $DB perp AC$ to the semicircle at $B = (a, sqrt{ab})$ so \(|DB| = \sqrt{ab} = G\).

  • Join radius $OB$ so \(|OB| = \frac{a+b}{2} = A\).

  • Drop $DF perp OB$ to foot $F$ so right-triangle similarity $triangle BFD sim triangle BDO$ gives \(|BF| = \frac{|DB|^2}{|OB|} = \frac{2ab}{a+b} = H\).

  • When $a ne b$ and include_harmonic_tangent=True, construct the circle tangent at $B$ meeting $AC$ at $T = left(frac{a(a+b)}{a-b}, 0right)$, exhibiting the exact harmonic conjugate $(A, C; D, T) = -1$ that bridges Book III’s mean theory to Book VII’s Porisms.

Parameters:
  • model_or_a – Either a Model or the first positive scalar $a$.

  • a_or_b – First scalar $a$ (when model_or_a is a Model) or second scalar $b$.

  • b – Second scalar $b$ when model_or_a is a Model.

  • model – Optional explicit Model keyword argument.

  • include_harmonic_tangent – If True and $a ne b$, construct tangent meet $T$ on $AC$.

Returns:

Populated ThreeMeansResult.

geometor.pappus.signed_area2(p1: sympy.geometry.Point, p2: sympy.geometry.Point, p3: sympy.geometry.Point) → sympy.Expr

Return twice the signed Euclidean area $det(p_2 - p_1, p_3 - p_1)$ of $triangle p_1 p_2 p_3$.

For a parallelogram with consecutive vertices $(p_1, p_2, p_2 + vec{w}, p_1 + vec{w})$, the signed area of the full parallelogram equals signed_area2(p1, p2, p1 + w).

Parameters:
  • p1 – First vertex.

  • p2 – Second vertex.

  • p3 – Third vertex.

Returns:

Simplified exact SymPy expression $(x_2 - x_1)(y_3 - y_1) - (y_2 - y_1)(x_3 - x_1)$.

geometor.pappus.verify_arbelos_chain_symbolic(n_max: int = 5) → dict[str, sympy.Expr]

Prove Pappus’s Arbelos Theorem symbolically over $mathbb{Q}(r_1, r_2, n)$.

Verifies four universal polynomial identities in $mathbb{Q}(r_1, r_2, n)$:

  1. Pappus’s Altitude Law: $y_n - n (2 r_n) = 0$ for symbolic $n$.

  2. Internal Tangency to Outer Semicircle: $Q(K_n, O_0) - (R - r_n)^2 = 0$.

  3. External Tangency to Left Semicircle: $Q(K_n, O_1) - (r_1 + r_n)^2 = 0$.

  4. Chain-to-Chain External Tangency: $Q(K_{n+1}, K_n) - (r_{n+1} + r_n)^2 = 0$ for symbolic $n$ (including $n = 0$, tangency of $C_1$ to $C_{mathrm{right}}$).

Parameters:

n_max – Optional positive check bound for explicit integer spot-checks alongside symbolic $n$.

Returns:

Dictionary mapping each invariant name to its simplified residual (all sp.Integer(0)).

geometor.pappus.verify_honeycomb_isoperimetry(perimeter: ScalarInput = 12, *, build_model: bool = False) → HoneycombIsoperimetryResult

Verify Pappus’s Book V Honeycomb Isoperimetry & Regular Planar Tiling Theorem.

Proves two pillars of Synagoge Book V (Preface & Prop. 1, Hultsch I, pp. 304–310):

  1. Uniqueness of Regular Planar Tilings: For $k ge 3$ congruent regular $n$-gons ($n ge 3$) to surround a point without gaps or overlaps, their interior angle $frac{n - 2}{n} cdot 180^circ$ must satisfy $k cdot frac{n - 2}{n} = 2$, i.e. $k = frac{2n}{n - 2} = 2 + frac{4}{n - 2} in mathbb{Z}_{ge 3}$, whose unique integer solutions are $(n - 2) in {1, 2, 4} iff n in {3, 4, 6}$ with $k in {6, 4, 3}$.

  2. Isoperimetric Superiority of the Hexagon: For common perimeter $P > 0$:

    \[\operatorname{Area}_3 = \frac{\sqrt{3}}{36} P^2, \qquad \operatorname{Area}_4 = \frac{1}{16} P^2, \qquad \operatorname{Area}_6 = \frac{\sqrt{3}}{24} P^2,\]

    giving $frac{operatorname{Area}_6}{operatorname{Area}_3} = frac{3}{2}$ and $frac{operatorname{Area}_6}{operatorname{Area}_4} = frac{2sqrt{3}}{3} > 1$ (since $left(frac{2sqrt{3}}{3}right)^2 = frac{4}{3} > 1$).

Parameters:
  • perimeter – Common positive perimeter $P$ (default 12, giving integer sides $4, 3, 2$).

  • build_model – If True, also construct the geometric Model.

Returns:

Populated HoneycombIsoperimetryResult.

geometor.pappus.verify_pappus_area_symbolic() → sympy.Expr

Verify Pappus’s Area Theorem universally over $mathbb{Q}(x_A, y_A, x_B, y_B, x_C, y_C, u_x, u_y, v_x, v_y)$.

Constructs generic symbolic points $A, B, C$ and generic parallelogram vectors $vec{u} = (u_x, u_y)$ and $vec{v} = (v_x, v_y)$, intersects the outer parallel lines $[DE]$ and $[FG]$ symbolically at $H$, translates $A - H$ onto base $BC$, and simplifies the oriented parallelogram area identity

\[\det(B - C, A - H) - \bigl(\det(A - B, \vec{u}) + \det(\vec{v}, A - C)\bigr).\]
Returns:

Exact simplified SymPy expression (identically sp.Integer(0)).

geometor.pappus.__version__ = '0.2.4'