modules

geometor.casey

Exact symbolic geometry constructions and Digital Scriptorium apparatus for John Casey’s Sequel.

Models the landmark theorems and straightedge-and-compass constructions of John Casey’s A Sequel to the First Six Books of the Elements of Euclid, Containing an Easy Introduction to Modern Geometry (5th ed. 1888 / 6th ed. 1892):

Submodules

Attributes

HERONIAN_VERTICES

Canonical Heronian (15, 13, 14) scalene triangle A=(0,0), B=(14,0), C=(5,12).

EMBEDDED_SVG_STYLE

__version__

Classes

BrocardLemoineReport

Exact rational invariant summary for Symmedian, Lemoine & Brocard geometry on (15,13,14).

BrocardLemoineResult

Constructed elements for Brocard Points, Brocard Circle, Lemoine Circle, Steiner & Tarry.

LemoineCirclesResult

Constructed elements for Symmedians, First Lemoine Circle & Cosine Circle (Unit 5).

CoaxialPencilResult

Constructed elements for the Disjoint Coaxal Pencil & Poncelet Limiting Points (Unit 2).

CoaxialTheoremReport

Symbolic verification certificate for Casey's Fundamental Theorem (Book III, Prop. 24).

ConcordanceEntry

Single proposition/topic concordance mapping across the GEOMETOR canon.

SympyCircleGap

Audit record comparing sympy.geometry.Circle against geometor.casey.

CaseyFeuerbachHeronianReport

Exact rational invariant report for Casey's Theorem & Feuerbach tangency on (15, 13, 14).

CaseyFeuerbachResult

Constructed elements for Casey's & Feuerbach's Theorem on (15, 13, 14) (Unit 4).

CaseySymbolicProof

Symbolic verification certificate for Casey's Generalized Ptolemy Theorem.

EulerNinePointResult

Constructed elements for the Euler Line and Nine-Points Circle (Unit 1).

CompleteQuadrilateralResult

Constructed elements for Casey's Complete Quadrilateral Harmonic Section (Unit 3).

LaHireSymbolicProof

Universal symbolic proof certificate for La Hire's Reciprocity & Harmonic Secants.

PolePolarResult

Constructed elements for Pole, Polar, Harmonic Secants & La Hire Reciprocity (Unit 4).

Functions

construct_brocard_and_lemoine_circles([model]) → BrocardLemoineResult

Construct the Brocard Points, Brocard Circle, First Lemoine Circle, Steiner & Tarry Points.

construct_symmedian_and_lemoine_circles([model]) → LemoineCirclesResult

Construct Lemoine's Point K, First Lemoine Circle & Cosine Circle (Unit 5).

verify_brocard_identities_symbolic() → dict[str, sympy.Expr]

Verify Casey's universal algebraic identities for cot(omega) and K's minimum property.

construct_radical_axis_and_coaxial_pencil([model]) → CoaxialPencilResult

Construct the radical axis, coaxal system, orthogonal pencil, and limiting points.

verify_coaxial_fundamental_theorem(c1, c2, c3_coaxial, ...) → CoaxialTheoremReport

Verify Casey Book III Props. 22–24 symbolically and on the constructed coaxal system.

audit_sympy_circle_gaps() → list[SympyCircleGap]

Inspect sympy.geometry.Circle for modern-circle-geometry primitives in Casey.

get_resources_dir() → pathlib.Path

Return the path to resources/sequel_to_euclid/ inside the repository.

load_apparatus_registry(name) → dict[str, Any]

Load a JSON apparatus file (persons, citations, glossary, sources_manifest).

load_concordance() → list[ConcordanceEntry]

Load all cross-repository concordance entries from concordance.json.

compass_internal_angle_bisector(model, vertex, arm_p1, ...) → sympy.geometry.Line

Construct the internal bisector of < arm_p1 vertex arm_p2 ) by Euclid I.9.

construct_casey_feuerbach([model]) → CaseyFeuerbachResult

Construct Casey's Inversion Proof & Feuerbach's Tangency Theorem on (15, 13, 14).

construct_euler_nine_point([model]) → EulerNinePointResult

Construct the Euler Line and Nine-Points Circle by straightedge and compass (Unit 1).

prove_casey_feuerbach_heronian() → CaseyFeuerbachHeronianReport

Verify Casey's bitangent equation and all 4 Feuerbach tangencies on Heronian (15, 13, 14).

prove_casey_theorem_symbolic() → CaseySymbolicProof

Prove Casey's Generalized Ptolemy Theorem & Feuerbach's Corollary symbolically.

are_orthogonal_circles(c1, c2) → bool

Return True iff circles c1 and c2 cut orthogonally (Casey Book III, Prop. 22).

barycentric_point(a_pt, b_pt, c_pt, w_a, w_b, w_c) → sympy.geometry.Point

Compute the exact homogeneous barycentric point (w_a : w_b : w_c) on ABC.

bitangent_length(c1, c2, *[, internal]) → sympy.Expr

Compute the exact common-tangent length t_12 between two circles or points.

bitangent_quadrance(c1, c2, *[, internal]) → sympy.Expr

Compute the exact squared common-tangent length t_12^2 between circles or null-circles.

circle_power(pt, circ) → sympy.Expr

Compute the exact power |PO|^2 - r^2 of point pt with respect to circ.

compass_midpoint(model, p1, p2, *[, ID, classes]) → sympy.geometry.Point

Construct the exact midpoint of p1 p2 by straightedge and compass (Euclid I.10).

compass_parallel_line(model, line_p1, line_p2, through, *) → sympy.geometry.Line

Construct the line through through parallel to line_p1 line_p2 (Euclid I.31).

compass_perp_bisector(model, p1, p2, *[, ID, classes, ...]) → sympy.geometry.Line

Construct the perpendicular bisector of p1 p2 by Euclid I.10 symmetric circles.

compass_perpendicular_line(model, line_p1, line_p2, ...) → sympy.geometry.Line

Construct the perpendicular to line line_p1 line_p2 through through.

invert_point(pt, center, radius_sq) → sympy.geometry.Point

Compute the exact circular inverse of pt with respect to (center, sqrt(radius_sq)).

polar_line(pt, circ) → sympy.geometry.Line

Compute the exact polar line of pt with respect to circ (Casey Book III, Def. p. 44).

pole_of_line(line, circ) → sympy.geometry.Point

Compute the exact pole of line with respect to circ (Casey Book III, Def. p. 44).

radical_axis_line(c1, c2) → sympy.geometry.Line

Compute the exact radical axis of two non-concentric circles (Casey Book III, Prop. 23).

signed_triangle_area(a_pt, b_pt, c_pt) → sympy.Expr

Compute the exact signed area of oriented triangle ABC.

construct_complete_quadrilateral_harmonic([model]) → CompleteQuadrilateralResult

Construct Casey's Complete Quadrilateral and verify harmonic diagonal division (Unit 3).

construct_pole_and_polar([model]) → PolePolarResult

Construct the Polar of D by straightedge and verify La Hire's Reciprocity (Unit 4).

verify_lahire_reciprocity_symbolic() → LaHireSymbolicProof

Prove La Hire's Reciprocity (Book III, Prop. 25) and Harmonic Secant Section (VI.III.4).

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

Write an interactive .euclid-graphic SVG rendering of model to output_path.

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

Render a Model into a complete .euclid-graphic SVG string.

Package Contents

class geometor.casey.BrocardLemoineReport

Exact rational invariant summary for Symmedian, Lemoine & Brocard geometry on (15,13,14).

cot_omega: sympy.Rational
sin_sq_omega: sympy.Rational
symmedian_point: sympy.geometry.Point
brocard_center: sympy.geometry.Point
brocard_1: sympy.geometry.Point
brocard_2: sympy.geometry.Point
brocard_first_triangle: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
steiner_point: sympy.geometry.Point
tarry_point: sympy.geometry.Point
longchamps_point: sympy.geometry.Point
lemoine_intercept_ratios: tuple[sympy.Rational, sympy.Rational]
min_perp_squares_sum: sympy.Rational
verified: bool
class geometor.casey.BrocardLemoineResult

Constructed elements for Brocard Points, Brocard Circle, Lemoine Circle, Steiner & Tarry.

model: geometor.model.Model
vertices: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
circumcenter: sympy.geometry.Point
circumcircle: sympy.geometry.Circle
symmedian_point: sympy.geometry.Point
brocard_center: sympy.geometry.Point
brocard_1: sympy.geometry.Point
brocard_2: sympy.geometry.Point
brocard_first_triangle: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
brocard_circle: sympy.geometry.Circle
lemoine_hexagon: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
first_lemoine_circle: sympy.geometry.Circle
steiner_point: sympy.geometry.Point
tarry_point: sympy.geometry.Point
longchamps_point: sympy.geometry.Point
report: BrocardLemoineReport
class geometor.casey.LemoineCirclesResult

Constructed elements for Symmedians, First Lemoine Circle & Cosine Circle (Unit 5).

model: geometor.model.Model
vertices: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
circumcenter: sympy.geometry.Point
circumcircle: sympy.geometry.Circle
tangential_vertices: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
symmedian_point: sympy.geometry.Point
lemoine_center: sympy.geometry.Point
lemoine_hexagon: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
first_lemoine_circle: sympy.geometry.Circle
cosine_hexagon: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
cosine_circle: sympy.geometry.Circle
geometor.casey.construct_brocard_and_lemoine_circles(model: geometor.model.Model | None = None) → BrocardLemoineResult

Construct the Brocard Points, Brocard Circle, First Lemoine Circle, Steiner & Tarry Points.

On the Heronian (15, 13, 14) triangle A=(0,0), B=(14,0), C=(5,12):

  1. Constructs O = (7, 33/8), K = X(6) = (1673/295, 1176/295), and the First Lemoine Circle centered at Ml = midpoint(O, K) = (4053/590, 9567/2360).

  2. Constructs the First Brocard Point ``Om1`` via tangent circles (Ob1, B) (tangent to BC at B through A) and (Oc1, C) (tangent to CA at C through B), verifying concurrency with (Oa1, A) (tangent to AB at A through C).

  3. Constructs the Second Brocard Point ``Om2`` via reversed tangent circles.

  4. Constructs Brocard’s First Triangle ``A1 B1 C1`` (A1 = [B Om1] ∩ [C Om2], etc.) and proves that all seven points ``O, K, Om1, Om2, A1, B1, C1`` lie on the Brocard Circle with diameter OK (Casey, Supp. Sec. V, pp. 194–195).

  5. Constructs Steiner’s Point ``St = X(99)`` (parallels through A, B, C to sides of A1 B1 C1), Tarry’s Point ``Tr = X(98)`` (antipode of St on circumcircle), and de Longchamps’ Point ``Lo = X(20)`` (reflection of H across O).

Parameters:

model – Optional existing Model.

Returns:

Populated BrocardLemoineResult with full exact symbolic report.

geometor.casey.construct_symmedian_and_lemoine_circles(model: geometor.model.Model | None = None) → LemoineCirclesResult

Construct Lemoine’s Point K, First Lemoine Circle & Cosine Circle (Unit 5).

Follows Casey, Supplementary Chapter, Sec. I, Props. 5–6 (pp. 170–171) and Sec. III, Prop. 1 & Cor. 4 (pp. 179–183) on A=(0,0), B=(14,0), C=(5,12).

Parameters:

model – Optional existing Model.

Returns:

Populated LemoineCirclesResult.

geometor.casey.verify_brocard_identities_symbolic() → dict[str, sympy.Expr]

Verify Casey’s universal algebraic identities for cot(omega) and K’s minimum property.

  1. By the Law of Cosines, cot A + cot B + cot C = (b^2+c^2-a^2)/(4*Delta) + (c^2+a^2-b^2)/(4*Delta) + (a^2+b^2-c^2)/(4*Delta) = (a^2+b^2+c^2)/(4*Delta).

  2. By Lagrange’s identity (Sec. I, Prop. 7, p. 171): (a^2+b^2+c^2)*(x^2+y^2+z^2) - (a*x+b*y+c*z)^2 = (b*z - c*y)^2 + (c*x - a*z)^2 + (a*y - b*x)^2, proving that under a*x+b*y+c*z = 2*Delta, x^2 + y^2 + z^2 attains its unique minimum when x/a = y/b = z/c (at K = X(6)).

Returns:

Dictionary of zero-verified symbolic residuals.

class geometor.casey.CoaxialPencilResult

Constructed elements for the Disjoint Coaxal Pencil & Poncelet Limiting Points (Unit 2).

model: geometor.model.Model
c1: sympy.geometry.Circle
c2: sympy.geometry.Circle
c3_coaxial: sympy.geometry.Circle
aux_secant_circle: sympy.geometry.Circle
radical_center: sympy.geometry.Point
radical_foot: sympy.geometry.Point
radical_axis: sympy.geometry.Line
line_of_centers: sympy.geometry.Line
tangent_contact_c1: sympy.geometry.Point
limiting_points: tuple[sympy.geometry.Point, sympy.geometry.Point]
orthogonal_circle_1: sympy.geometry.Circle
orthogonal_circle_2: sympy.geometry.Circle
report: CoaxialTheoremReport
class geometor.casey.CoaxialTheoremReport

Symbolic verification certificate for Casey’s Fundamental Theorem (Book III, Prop. 24).

symbolic_prop24_residual: sympy.Expr
radical_axis_power_diff: sympy.Expr
limiting_point_power_c1: sympy.Expr
limiting_point_power_c2: sympy.Expr
orthogonal_to_c1: bool
orthogonal_to_c2: bool
orthogonal_to_c3: bool
verified: bool
geometor.casey.construct_radical_axis_and_coaxial_pencil(model: geometor.model.Model | None = None) → CoaxialPencilResult

Construct the radical axis, coaxal system, orthogonal pencil, and limiting points.

Uses exact integer-rational circles C1 = ((-10, 0), 6) and C2 = ((17, 0), 15):

  1. Draws an auxiliary secant circle C_aux = ((2, 8), 10) cutting C1 in U1, V1 and C2 in U2, V2 (Casey Book III, Prop. 28).

  2. Intersects common chords [U1 V1] and [U2 V2] to obtain the Radical Centre Rc = (0, -6) (Book III, Prop. 23, Cor. 2).

  3. Drops the perpendicular from Rc to the line of centres [O1 O2] to construct the Radical Axis x = 0 and foot D = (0, 0).

  4. Constructs the tangent D T1 to C1 by Euclid III.17 (Thales circle on O1 D) and transfers |D T1| = 8 onto [O1 O2] via circle (D, T1) to construct Poncelet’s Limiting Points L1 = (-8, 0) and L2 = (8, 0).

  5. Constructs two members (Rc, L1) and (D, T1) of the conjugate orthogonal pencil passing through L1, L2 and cutting C1, C2, C3 orthogonally.

Parameters:

model – Optional existing Model.

Returns:

Populated CoaxialPencilResult with exact coordinates and verification report.

geometor.casey.verify_coaxial_fundamental_theorem(c1: sympy.geometry.Circle, c2: sympy.geometry.Circle, c3_coaxial: sympy.geometry.Circle, orth_circle: sympy.geometry.Circle, limiting_points: tuple[sympy.geometry.Point, sympy.geometry.Point]) → CoaxialTheoremReport

Verify Casey Book III Props. 22–24 symbolically and on the constructed coaxal system.

Parameters:
  • c1 – First primary circle of the coaxal pencil.

  • c2 – Second primary circle of the coaxal pencil.

  • c3_coaxial – Third circle belonging to the same coaxal pencil.

  • orth_circle – Conjugate circle cutting the pencil orthogonally.

  • limiting_points – Pair (L1, L2) of Poncelet limiting points.

Returns:

Frozen CoaxialTheoremReport certificate.

class geometor.casey.ConcordanceEntry

Single proposition/topic concordance mapping across the GEOMETOR canon.

id: str
unit: str
casey_locus: str
folio: str
page: str
title: str
euclid_refs: tuple[str, ...]
altshiller_court_refs: tuple[str, ...]
etc_centers: tuple[str, ...]
pappus_refs: tuple[str, ...]
casey_symbol: str
class geometor.casey.SympyCircleGap

Audit record comparing sympy.geometry.Circle against geometor.casey.

capability: str
sympy_method_present: bool
casey_locus: str
geometor_casey_api: str
geometor.casey.audit_sympy_circle_gaps() → list[SympyCircleGap]

Inspect sympy.geometry.Circle for modern-circle-geometry primitives in Casey.

Returns:

List of SympyCircleGap entries documenting native presence vs. geometor.casey exact symbolic implementations.

geometor.casey.get_resources_dir() → pathlib.Path

Return the path to resources/sequel_to_euclid/ inside the repository.

geometor.casey.load_apparatus_registry(name: str) → dict[str, Any]

Load a JSON apparatus file (persons, citations, glossary, sources_manifest).

Parameters:

name – Filename stem without .json extension.

Returns:

Parsed JSON dictionary.

geometor.casey.load_concordance() → list[ConcordanceEntry]

Load all cross-repository concordance entries from concordance.json.

Returns:

List of ConcordanceEntry records in codex order.

class geometor.casey.CaseyFeuerbachHeronianReport

Exact rational invariant report for Casey’s Theorem & Feuerbach tangency on (15, 13, 14).

sides: tuple[sympy.Integer, sympy.Integer, sympy.Integer]
area: sympy.Rational
inradius: sympy.Rational
circumradius: sympy.Rational
nine_point_radius: sympy.Rational
exradii: tuple[sympy.Rational, sympy.Rational, sympy.Rational]
midpoint_chords: tuple[sympy.Rational, sympy.Rational, sympy.Rational]
incircle_midpoint_tangents: tuple[sympy.Rational, sympy.Rational, sympy.Rational]
casey_signed_sum: sympy.Expr
feuerbach_point: sympy.geometry.Point
excircle_feuerbach_points: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
ni_distance: sympy.Rational
inversion_circle_orthogonal_to_incircle: bool
inversion_circle_orthogonal_to_excircle_a: bool
verified: bool
class geometor.casey.CaseyFeuerbachResult

Constructed elements for Casey’s & Feuerbach’s Theorem on (15, 13, 14) (Unit 4).

model: geometor.model.Model
euler_nine_point: EulerNinePointResult
incenter: sympy.geometry.Point
incircle_contacts: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
incircle: sympy.geometry.Circle
feuerbach_point: sympy.geometry.Point
casey_inversion_circle: sympy.geometry.Circle
fourth_common_tangent: sympy.geometry.Line
class geometor.casey.CaseySymbolicProof

Symbolic verification certificate for Casey’s Generalized Ptolemy Theorem.

inversion_invariance_residual: sympy.Expr
tangent_line_euler_residual: sympy.Expr
incircle_casey_residual: sympy.Expr
incircle_cor2_squares_residual: sympy.Expr
excircle_a_casey_residual: sympy.Expr
verified: bool
class geometor.casey.EulerNinePointResult

Constructed elements for the Euler Line and Nine-Points Circle (Unit 1).

model: geometor.model.Model
vertices: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
midpoints: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
altitude_feet: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
euler_midpoints: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
centroid: sympy.geometry.Point
circumcenter: sympy.geometry.Point
orthocenter: sympy.geometry.Point
nine_point_center: sympy.geometry.Point
euler_line: sympy.geometry.Line
circumcircle: sympy.geometry.Circle
nine_point_circle: sympy.geometry.Circle
geometor.casey.compass_internal_angle_bisector(model: geometor.model.Model, vertex: sympy.geometry.Point, arm_p1: sympy.geometry.Point, arm_p2: sympy.geometry.Point, *, ID: str = '', classes: list[str] | None = None, guide: bool = False) → sympy.geometry.Line

Construct the internal bisector of < arm_p1 vertex arm_p2 ) by Euclid I.9.

Transfers |vertex arm_p1| onto ray vertex arm_p2 via circle (vertex, arm_p1) and bisects the resulting isosceles base chord.

Parameters:
  • model – Target Model.

  • vertex – Angle vertex.

  • arm_p1 – Point on the first ray.

  • arm_p2 – Point on the second ray.

  • ID – Optional explicit line identifier.

  • classes – Optional semantic CSS classes.

  • guide – Whether the angle bisector should remain a guide.

Returns:

Exact internal angle bisector sympy.geometry.Line.

geometor.casey.construct_casey_feuerbach(model: geometor.model.Model | None = None) → CaseyFeuerbachResult

Construct Casey’s Inversion Proof & Feuerbach’s Tangency Theorem on (15, 13, 14).

Builds the Nine-Points Circle, constructs the Incentre I and Incircle (I, Ta) by pure compass-and-straightedge (Euclid IV.4), erects Casey’s 1861 orthogonal inversion circle (Ma, Ta) (Book VI, Sec. IV, p. 106), constructs the fourth common internal tangent of (I, r) and (Ia, r_a) via reflection across line of centres AI, and discovers the exact Feuerbach point Fe = X(11) = (6, 8) as (N, Ma) ∩ (I, Ta).

Parameters:

model – Optional existing Model.

Returns:

Populated CaseyFeuerbachResult.

geometor.casey.construct_euler_nine_point(model: geometor.model.Model | None = None) → EulerNinePointResult

Construct the Euler Line and Nine-Points Circle by straightedge and compass (Unit 1).

Follows Casey, Book I, Misc. Ex. 42–46 (p. 20) and Book IV, Prop. 5 (pp. 57–58) on A=(0,0), B=(14,0), C=(5,12), verifying exact incidence of all nine classical points and Euler trisection |HG|^2 = 4*|GO|^2.

Parameters:

model – Optional existing Model. Created with auto_intersect=False when None.

Returns:

Populated EulerNinePointResult.

geometor.casey.prove_casey_feuerbach_heronian() → CaseyFeuerbachHeronianReport

Verify Casey’s bitangent equation and all 4 Feuerbach tangencies on Heronian (15, 13, 14).

Evaluates exact coordinates on A=(0,0), B=(14,0), C=(5,12) (a=15, b=13, c=14), confirming:

  • Midpoint chords t_23 = 15/2, t_31 = 13/2, t_12 = 7.

  • Midpoint-to-incircle bitangents |Ma Ta| = 1/2, |Mb Tb| = 1/2, |Mc Tc| = 1.

  • Casey’s equation (15/2)*(1/2) + (13/2)*(1/2) - 7*1 = 15/4 + 13/4 - 7 = 0.

  • Internal tangency of Nine-Points Circle N=(6, 63/16), R_9=65/16 with Incircle I=(6, 4), r=4 at Fe = X(11) = (6, 8) with |NI| = 1/16 = R_9 - r.

  • External tangency of Nine-Points Circle with all three Excircles (Ia, r_a), (Ib, r_b), (Ic, r_c) with |N I_k| = R_9 + r_k.

  • Casey’s 1861 inversion circle (Ma, 1/2) cuts both (I, 4) and (Ia, 14) orthogonally and inverts their fourth common internal tangent into the Nine-Points Circle.

Returns:

Frozen CaseyFeuerbachHeronianReport with exact rational values.

geometor.casey.prove_casey_theorem_symbolic() → CaseySymbolicProof

Prove Casey’s Generalized Ptolemy Theorem & Feuerbach’s Corollary symbolically.

Verifies four algebraic pillars from Casey, Book VI, Sec. IV, Props. 9–10 (pp. 102–106):

  1. Inversion Invariance (Prop. 9, pp. 102–103): Under inversion in (O, k) at the origin, for two circles (x1, y1, r1) and (x2, y2, r2) not passing through O, the normalized bitangent ratio t_12^2 / (r1 * r2) is strictly invariant: t'_12^2 / (r'_1 * r'_2) - t_12^2 / (r1 * r2) == 0.

  2. Collinear Contact Reduction (Prop. 10, pp. 103–104): Inverting from a point on the fifth tangent circle maps it to y = 0 and the four tangent circles to (u_i, r_i) with t_ij = |u_i - u_j|, reducing t_12*t_34 + t_14*t_23 = t_13*t_24 for ordered contacts u_1 < u_2 < u_3 < u_4 to Euler’s identity (Book II, Prop. 7, p. 24).

  3. Universal Incircle Bitangent Identity (Prop. 10, Cor. 2, pp. 104–105): For general positive side lengths b <= c <= a, t_23 = a/2, t_31 = b/2, t_12 = c/2 and t_14 = (c - b)/2, t_24 = (a - c)/2, t_34 = (a - b)/2 satisfy t_23*t_14 + t_31*t_24 - t_12*t_34 == 0, alongside Casey’s squared identity (b^2 - c^2) + (c^2 - a^2) + (a^2 - b^2) == 0.

  4. Universal Excircle Bitangent Identity: For the A-excircle, t_14 = (c - b)/2, t_24 = (a + c)/2, t_34 = (a + b)/2 satisfy t_23*t_14 + t_31*t_24 - t_12*t_34 == 0 (with t_31*t_24 = t_12*t_34 + t_23*t_14).

Returns:

Frozen CaseySymbolicProof certificate with zero residuals.

geometor.casey.HERONIAN_VERTICES: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]

Canonical Heronian (15, 13, 14) scalene triangle A=(0,0), B=(14,0), C=(5,12).

geometor.casey.are_orthogonal_circles(c1: sympy.geometry.Circle, c2: sympy.geometry.Circle) → bool

Return True iff circles c1 and c2 cut orthogonally (Casey Book III, Prop. 22).

Two circles cut orthogonally iff the square of the distance between their centres equals the sum of the squares of their radii: |O1 O2|^2 = r1^2 + r2^2.

Parameters:
  • c1 – First circle (O1, r1).

  • c2 – Second circle (O2, r2).

Returns:

True if |O1 O2|^2 - r1^2 - r2^2 == 0 symbolically.

geometor.casey.barycentric_point(a_pt: sympy.geometry.Point, b_pt: sympy.geometry.Point, c_pt: sympy.geometry.Point, w_a: sympy.Expr, w_b: sympy.Expr, w_c: sympy.Expr) → sympy.geometry.Point

Compute the exact homogeneous barycentric point (w_a : w_b : w_c) on ABC.

Implements Casey’s Centre of Mean Position (Book I, Props. 17–18, pp. 12–13) and symmedian/Brocard weights (Supplementary Chapter, Secs. I–II).

Parameters:
  • a_pt – First vertex A.

  • b_pt – Second vertex B.

  • c_pt – Third vertex C.

  • w_a – Weight attached to A.

  • w_b – Weight attached to B.

  • w_c – Weight attached to C.

Returns:

Exact sympy.geometry.Point (w_a*A + w_b*B + w_c*C) / (w_a + w_b + w_c).

Raises:

ValueError – If w_a + w_b + w_c == 0.

geometor.casey.bitangent_length(c1: sympy.geometry.Circle | sympy.geometry.Point, c2: sympy.geometry.Circle | sympy.geometry.Point, *, internal: bool = False) → sympy.Expr

Compute the exact common-tangent length t_12 between two circles or points.

Parameters:
  • c1 – First circle or null-circle point.

  • c2 – Second circle or null-circle point.

  • internal – If True, return the internal common-tangent length; else external.

Returns:

Exact symbolic principal square root sqrt(bitangent_quadrance(c1, c2)).

geometor.casey.bitangent_quadrance(c1: sympy.geometry.Circle | sympy.geometry.Point, c2: sympy.geometry.Circle | sympy.geometry.Point, *, internal: bool = False) → sympy.Expr

Compute the exact squared common-tangent length t_12^2 between circles or null-circles.

In Casey’s Generalized Ptolemy Theorem (Book VI, Sec. IV, Prop. 10, pp. 103–104), a point is treated as a circle of radius 0. For two circles soaked in the same sense (external common tangent), t_12^2 = |O1 O2|^2 - (r1 - r2)^2; for transverse (internal) contact, t_12^2 = |O1 O2|^2 - (r1 + r2)^2.

Parameters:
  • c1 – First sympy.geometry.Circle or null-circle sympy.geometry.Point.

  • c2 – Second sympy.geometry.Circle or null-circle sympy.geometry.Point.

  • internal – If True, use (r1 + r2)^2 (internal bitangent); otherwise (r1 - r2)^2.

Returns:

Exact symbolic squared bitangent length.

geometor.casey.circle_power(pt: sympy.geometry.Point, circ: sympy.geometry.Circle) → sympy.Expr

Compute the exact power |PO|^2 - r^2 of point pt with respect to circ.

Corresponds to Casey, Book III, Props. 20–24 (pp. 41–44): for exterior points, equals the square of the tangent from pt to circ.

Parameters:
  • pt – Query point P.

  • circ – Reference circle (O, r).

Returns:

Exact symbolic expression (P.x - O.x)^2 + (P.y - O.y)^2 - r^2.

geometor.casey.compass_midpoint(model: geometor.model.Model, p1: sympy.geometry.Point, p2: sympy.geometry.Point, *, ID: str = '', classes: list[str] | None = None) → sympy.geometry.Point

Construct the exact midpoint of p1 p2 by straightedge and compass (Euclid I.10).

Parameters:
  • model – Target Model.

  • p1 – First endpoint.

  • p2 – Second endpoint.

  • ID – Optional explicit point identifier.

  • classes – Optional semantic CSS classes.

Returns:

Exact midpoint sympy.geometry.Point.

geometor.casey.compass_parallel_line(model: geometor.model.Model, line_p1: sympy.geometry.Point, line_p2: sympy.geometry.Point, through: sympy.geometry.Point, *, ID: str = '', classes: list[str] | None = None, guide: bool = False) → sympy.geometry.Line

Construct the line through through parallel to line_p1 line_p2 (Euclid I.31).

Constructs the fourth vertex Q = line_p2 + through - line_p1 of parallelogram line_p1 line_p2 Q through by bisecting diagonal line_p2 through at M and doubling line_p1 M via circle (M, line_p1).

Parameters:
  • model – Target Model.

  • line_p1 – First point on the reference line.

  • line_p2 – Second point on the reference line.

  • through – Exterior point through which the parallel is drawn.

  • ID – Optional explicit line identifier.

  • classes – Optional semantic CSS classes.

  • guide – Whether the parallel line should remain a guide.

Returns:

Exact parallel sympy.geometry.Line passing through through.

geometor.casey.compass_perp_bisector(model: geometor.model.Model, p1: sympy.geometry.Point, p2: sympy.geometry.Point, *, ID: str = '', classes: list[str] | None = None, guide: bool = False) → sympy.geometry.Line

Construct the perpendicular bisector of p1 p2 by Euclid I.10 symmetric circles.

Parameters:
  • model – Target Model.

  • p1 – First endpoint.

  • p2 – Second endpoint.

  • ID – Optional explicit line identifier.

  • classes – Optional semantic CSS classes.

  • guide – Whether the resulting bisector should remain a guide.

Returns:

Exact perpendicular bisector sympy.geometry.Line.

geometor.casey.compass_perpendicular_line(model: geometor.model.Model, line_p1: sympy.geometry.Point, line_p2: sympy.geometry.Point, through: sympy.geometry.Point, *, off_line_ref: sympy.geometry.Point | None = None, ID: str = '', classes: list[str] | None = None, guide: bool = False) → sympy.geometry.Line

Construct the perpendicular to line line_p1 line_p2 through through.

Uses rational circle reflection (Euclid I.12) when through lies off the line, and Thales’s semicircle construction (Euclid III.31) via off_line_ref (or equilateral fallback) when through lies on the line—preserving rational fields without extraneous nested radicals whenever off_line_ref is provided.

Parameters:
  • model – Target Model.

  • line_p1 – First point defining the base line.

  • line_p2 – Second point defining the base line.

  • through – Point through which the perpendicular is drawn.

  • off_line_ref – Optional known point not lying on line_p1 line_p2 for Thales III.31.

  • ID – Optional explicit line identifier.

  • classes – Optional semantic CSS classes.

  • guide – Whether the perpendicular line should remain a guide.

Returns:

Exact perpendicular sympy.geometry.Line passing through through.

geometor.casey.invert_point(pt: sympy.geometry.Point, center: sympy.geometry.Point, radius_sq: sympy.Expr) → sympy.geometry.Point

Compute the exact circular inverse of pt with respect to (center, sqrt(radius_sq)).

Implements Casey, Book III, Def. (p. 41) & Book VI, Sec. IV, Def. (p. 95): collinear with center and pt on the same ray such that |O P| * |O P'| = k^2.

Parameters:
  • pt – Point P distinct from center.

  • center – Centre of inversion O.

  • radius_sq – Square k^2 of the radius of inversion.

Returns:

Exact inverted sympy.geometry.Point P'.

Raises:

ValueError – If pt coincides with center.

geometor.casey.polar_line(pt: sympy.geometry.Point, circ: sympy.geometry.Circle) → sympy.geometry.Line

Compute the exact polar line of pt with respect to circ (Casey Book III, Def. p. 44).

By Casey’s definition, the polar of P with respect to (O, r) is the perpendicular to ray OP erected at the inverse point P' of P. Note that sympy.geometry.Circle natively lacks polar_line and pole_of_line methods.

Parameters:
  • pt – Pole P distinct from circ.center.

  • circ – Reference circle (O, r).

Returns:

Exact sympy.geometry.Line representing polar(P).

Raises:

ValueError – If pt coincides with circ.center.

geometor.casey.pole_of_line(line: sympy.geometry.Line, circ: sympy.geometry.Circle) → sympy.geometry.Point

Compute the exact pole of line with respect to circ (Casey Book III, Def. p. 44).

Constructed algebraically as the circular inverse of the orthogonal foot of circ.center upon line.

Parameters:
  • line – Non-diametral sympy.geometry.Line.

  • circ – Reference circle (O, r).

Returns:

Exact sympy.geometry.Point whose polar with respect to circ is line.

Raises:

ValueError – If line passes through circ.center (pole is at infinity).

geometor.casey.radical_axis_line(c1: sympy.geometry.Circle, c2: sympy.geometry.Circle) → sympy.geometry.Line

Compute the exact radical axis of two non-concentric circles (Casey Book III, Prop. 23).

Parameters:
  • c1 – First circle (O1, r1).

  • c2 – Second circle (O2, r2).

Returns:

Exact sympy.geometry.Line locus of equal circle powers.

Raises:

ValueError – If c1 and c2 are concentric.

geometor.casey.signed_triangle_area(a_pt: sympy.geometry.Point, b_pt: sympy.geometry.Point, c_pt: sympy.geometry.Point) → sympy.Expr

Compute the exact signed area of oriented triangle ABC.

Parameters:
  • a_pt – First vertex A.

  • b_pt – Second vertex B.

  • c_pt – Third vertex C.

Returns:

Exact symbolic signed area ((B.x - A.x)*(C.y - A.y) - (B.y - A.y)*(C.x - A.x)) / 2.

class geometor.casey.CompleteQuadrilateralResult

Constructed elements for Casey’s Complete Quadrilateral Harmonic Section (Unit 3).

model: geometor.model.Model
quad_vertices: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
opposite_meets: tuple[sympy.geometry.Point, sympy.geometry.Point]
diagonal_center: sympy.geometry.Point
third_diagonal_meets: tuple[sympy.geometry.Point, sympy.geometry.Point]
cross_ratio_ac: sympy.Expr
cross_ratio_bd: sympy.Expr
class geometor.casey.LaHireSymbolicProof

Universal symbolic proof certificate for La Hire’s Reciprocity & Harmonic Secants.

reciprocity_bilinear_diff: sympy.Expr
secant_cross_ratio: sympy.Expr
verified: bool
class geometor.casey.PolePolarResult

Constructed elements for Pole, Polar, Harmonic Secants & La Hire Reciprocity (Unit 4).

model: geometor.model.Model
circle: sympy.geometry.Circle
center: sympy.geometry.Point
pole_d: sympy.geometry.Point
secant_1_pts: tuple[sympy.geometry.Point, sympy.geometry.Point]
secant_2_pts: tuple[sympy.geometry.Point, sympy.geometry.Point]
self_conjugate_triangle: tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]
polar_d: sympy.geometry.Line
harmonic_meets: tuple[sympy.geometry.Point, sympy.geometry.Point]
reciprocal_pole_q: sympy.geometry.Point
polar_q: sympy.geometry.Line
cross_ratio_secant_1: sympy.Expr
cross_ratio_secant_2: sympy.Expr
lahire_verified: bool
geometor.casey.construct_complete_quadrilateral_harmonic(model: geometor.model.Model | None = None) → CompleteQuadrilateralResult

Construct Casey’s Complete Quadrilateral and verify harmonic diagonal division (Unit 3).

Follows Casey, Book VI, Sec. III, Prop. 7 (p. 91) using pure straightedge incidences on exact integer vertices A=(0, 0), B=(6, 0), C=(4, 2), D=(2, 3):

  • Opposite side meets: E = [AB] ∩ [CD] = (8, 0) and F = [AD] ∩ [BC] = (12/5, 18/5).

  • Internal diagonal meet: P = [AC] ∩ [BD] = (18/5, 9/5).

  • Third diagonal [EF] cuts [AC] at Qa = (9/2, 9/4) and [BD] at Qb = (-6, 9) such that (A, C; P, Qa) = -1 and (B, D; P, Qb) = -1.

Parameters:

model – Optional existing Model.

Returns:

Populated CompleteQuadrilateralResult.

geometor.casey.construct_pole_and_polar(model: geometor.model.Model | None = None) → PolePolarResult

Construct the Polar of D by straightedge and verify La Hire’s Reciprocity (Unit 4).

On circle (O, R0) with O = (0, 0) and R0 = (5, 0) (x^2 + y^2 = 25):

  1. Draws two rational secants cutting the circle in G1=(0, 5), H1=(4, 3) and G2=(-3, -4), H2=(5, 0), meeting at exterior pole D = (15/2, 5/4).

  2. Constructs the remaining diagonal vertices U = [G1 H2] ∩ [G2 H1] = (3, 2) and V = [G1 G2] ∩ [H1 H2] = (5/3, 10) of the inscribed quadrangle; their join [U V] is polar(D): 6x + y - 20 = 0, and D U V is a Self-Conjugate Triangle (Casey, Book VI, Sec. VII, Prop. 2, p. 142).

  3. Intersects polar(D) with both secants at J1, J2 and verifies Casey’s Harmonic Secant Theorem (G1, H1; J1, D) = (G2, H2; J2, D) = -1 (Sec. III, Prop. 4, p. 89).

  4. Selects exterior point Q = (4, -4) on polar(D), constructs its two tangents to (O, 5) by Thales semicircle on OQ, draws chord of contact polar(Q) (Book III, Prop. 27, p. 47), and asserts La Hire’s Reciprocity D in polar(Q) (Book III, Prop. 25, p. 45).

Parameters:

model – Optional existing Model.

Returns:

Populated PolePolarResult.

geometor.casey.verify_lahire_reciprocity_symbolic() → LaHireSymbolicProof

Prove La Hire’s Reciprocity (Book III, Prop. 25) and Harmonic Secant Section (VI.III.4).

  1. For circle (x - h)^2 + (y - k)^2 = r^2, polar(P) has equation (x1 - h)(x - h) + (y1 - k)(y - k) - r^2 = 0, which is symmetric in (x1, y1) and (x2, y2).

  2. For exterior pole D = (d, 0) on diameter secant y = 0 cutting x^2 + y^2 = r^2 at G = (-r, 0), H = (r, 0) with polar foot J = (r^2/d, 0), the anharmonic ratio (G, H; J, D) simplifies identically to -1.

Returns:

Frozen LaHireSymbolicProof certificate.

geometor.casey.EMBEDDED_SVG_STYLE: str = ''
geometor.casey.export_svg(model: geometor.model.Model, output_path: str | pathlib.Path, *, graphic_id: str = 'g1', title: str = 'Casey Euclidean Circle Construction', width: int = 680, height: int = 480, margin: float = 42.0, bbox: tuple[float, float, float, float] | None = None, focus_points: collections.abc.Sequence[sympy.geometry.Point] | None = None, include_guides: bool = False, show_labels: bool = True, label_overrides: dict[str, tuple[str, str]] | None = None, highlight_point_ids: collections.abc.Sequence[str] | None = None) → pathlib.Path

Write an interactive .euclid-graphic SVG rendering of model to output_path.

Parameters:
  • model – Populated Model.

  • output_path – Destination .svg file path.

  • 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 viewport.

  • 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.

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

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

Returns:

Resolved pathlib.Path of the written SVG file.

geometor.casey.render_svg_string(model: geometor.model.Model, *, graphic_id: str = 'g1', title: str = 'Casey Euclidean Circle Construction', width: int = 680, height: int = 480, margin: float = 42.0, bbox: tuple[float, float, float, float] | None = None, focus_points: collections.abc.Sequence[sympy.geometry.Point] | None = None, include_guides: bool = False, show_labels: bool = True, label_overrides: dict[str, tuple[str, str]] | None = None, highlight_point_ids: collections.abc.Sequence[str] | None = None) → str

Render a Model into a complete .euclid-graphic 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 viewport.

  • 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.

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

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

Returns:

UTF-8 XML/SVG string.

geometor.casey.__version__ = '0.1.0'