modules¶
geometor.etc¶
Tools for processing and modeling the Encyclopedia of Triangle Centers (ETC).
Key Components¶
Triangles: Exact canonical symbolic reference triangles (
geometor.etc.triangles).Symbolic Cache: Exact symbolic center evaluator and disk cache (
geometor.etc.symbolic_cache).Ops: Exact Euclidean construction primitives and canonical Principles of Geometry operators (
geometor.etc.ops).Ingest: Tools (
ingest_folder()) to split and organize the raw HTML source.Parser: Tools (
parse_center()) to extract center data from HTML.Glossary: Tools (
extract_glossary_terms()) to handle glossary terms, persons, and citations.Construct: Coordinate/incidence resolver,
Modelbuilder, and per-centermodel.pygenerator (geometor.etc.construct).Render: Explorer-styled SVG renderer with exact symbolic HUD metadata (
geometor.etc.render).Transform: Tools (
generate_rst_files()) to generate per-center ReStructuredText folders and graphics.
Submodules¶
Attributes¶
Classes¶
Concordance entry linking canonical function names, Kimberling IDs, and classical citations. |
|
Exact symbolic evaluator and persistent cache for ETC triangle centers. |
|
Exact symbolic coordinates and invariants for center |
|
Exact symbolic reference triangle with side lengths, vertices, and invariants. |
Functions¶
|
Extract all glossary terms, their rich RST bodies, and plain-text summaries from GLOSSARY HTML. |
|
Generate rich docsrc/glossary.rst with deterministic #term-<slug> anchors. |
|
Ingest all ETC volume HTML files in input_folder and write split files to output_folder. |
|
Construct the Bevan point |
|
Construct the centroid |
|
Construct the circumcenter |
|
Construct |
|
Construct the Clawson point |
|
Construct an exact symbolic triangle with side ratios |
|
Construct one of the 4 canonical exact symbolic reference triangles in |
|
Create a silent exact |
|
Construct the de Longchamps point |
|
Construct the 1st isogonic center (Fermat point) |
|
Construct the Feuerbach point |
|
Construct the 1st isodynamic point |
|
Construct the 1st Napoleon point |
|
Construct the Gergonne point |
|
Return the |
|
Construct |
|
Construct the incenter |
|
Construct |
|
Construct the Mittenpunkt |
|
Construct the Nagel point |
|
Construct the nine-point center |
|
Construct the orthocenter |
|
Construct the 2nd isodynamic point |
|
Construct the 2nd isogonic center |
|
Construct the 2nd Napoleon point |
|
Construct the Spieker center |
|
Construct the symmedian (Lemoine) point |
|
Parse a center's HTML content into a rich structured dictionary. |
|
Generate thematic collection folders (c-XXXXX-YYYYY/) and per-center folders (x-NNNNN/). |
|
Return a canonical |
Package Contents¶
- geometor.etc.extract_glossary_terms(html_content: str) dict[str, Any]¶
Extract all glossary terms, their rich RST bodies, and plain-text summaries from GLOSSARY HTML.
- geometor.etc.generate_glossary_rst(terms: dict[str, Any], intro_rst: str = '', valid_centers: set[int] | None = None) str¶
Generate rich docsrc/glossary.rst with deterministic #term-<slug> anchors.
- geometor.etc.ingest_folder(input_folder: str | pathlib.Path, output_folder: str | pathlib.Path) dict[str, Any]¶
Ingest all ETC volume HTML files in input_folder and write split files to output_folder.
Returns a summary dictionary with counts of centers, preambles, and intro sections.
- geometor.etc.CANONICAL_CENTER_CONCORDANCE: dict[int, CenterConcordance]¶
- class geometor.etc.CenterConcordance¶
Concordance entry linking canonical function names, Kimberling IDs, and classical citations.
- geometor.etc.bevan_point(model: geometor.model.Model, A: sympy.geometry.Point, B: sympy.geometry.Point, C: sympy.geometry.Point, ID: str = 'X40', classes: list[str] | None = None) sympy.geometry.Point¶
Construct the Bevan point
X_40(reflection ofX_1acrossX_3).
- geometor.etc.centroid(model: geometor.model.Model, A: sympy.geometry.Point, B: sympy.geometry.Point, C: sympy.geometry.Point, ID: str = 'X2', classes: list[str] | None = None, draw_medians: bool = False) sympy.geometry.Point¶
Construct the centroid
X_2of triangleABC.
- geometor.etc.circumcenter(model: geometor.model.Model, A: sympy.geometry.Point, B: sympy.geometry.Point, C: sympy.geometry.Point, ID: str = 'X3', classes: list[str] | None = None, draw_bisectors: bool = False, draw_circumcircle: bool = False) sympy.geometry.Point¶
Construct the circumcenter
X_3of triangleABC(Euclid IV.5).
- geometor.etc.circumcircle_inverse_of_incenter(model: geometor.model.Model, A: sympy.geometry.Point, B: sympy.geometry.Point, C: sympy.geometry.Point, ID: str = 'X36', classes: list[str] | None = None) sympy.geometry.Point¶
Construct
X_36, the circumcircle inverse ofX_1.
- geometor.etc.clawson_point(model: geometor.model.Model, A: sympy.geometry.Point, B: sympy.geometry.Point, C: sympy.geometry.Point, ID: str = 'X19', classes: list[str] | None = None) sympy.geometry.Point¶
Construct the Clawson point
X_19.
- geometor.etc.construct_baseline_triangle(model: geometor.model.Model, a: sympy.Expr | float = 15, b: sympy.Expr | float = 13, c: sympy.Expr | float = 14, show_guides: bool = False, *, unit_baseline: bool = True) tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]¶
Construct an exact symbolic triangle with side ratios
(a, b, c).Preserves backward compatibility for scripts calling
construct_baseline_triangle(model, 5, 6, 7)while computing exact algebraic coordinates without floating-point approximations.
- geometor.etc.construct_reference_triangle(model: geometor.model.Model, preset: str | geometor.etc.triangles.SymbolicTriangle = 'heronian', *, unit_baseline: bool = False, show_guides: bool = False) tuple[sympy.geometry.Point, sympy.geometry.Point, sympy.geometry.Point]¶
Construct one of the 4 canonical exact symbolic reference triangles in
model.- Parameters:
model – Target
geometor.model.Model.preset – Canonical preset key (
"heronian","right","kepler","kimberling") or aSymbolicTriangle.unit_baseline – When
True, normalizes side \(AB = 1\). Defaults toFalseso Heronian \((15, 13, 14)\) and Right \((3, 4, 5)\) preserve exact integer vertex and center coordinates.show_guides – When
True, includes Euclid I.22 compass guide circles centered at \(A\) and \(B\).
- geometor.etc.create_model(name: str = 'ETC Construction') geometor.model.Model¶
Create a silent exact
geometor.model.Modelwithauto_intersect=False.
- geometor.etc.de_longchamps_point(model: geometor.model.Model, A: sympy.geometry.Point, B: sympy.geometry.Point, C: sympy.geometry.Point, ID: str = 'X20', classes: list[str] | None = None) sympy.geometry.Point¶
Construct the de Longchamps point
X_20(reflection ofX_4inX_3).
- geometor.etc.fermat_point(model: geometor.model.Model, A: sympy.geometry.Point, B: sympy.geometry.Point, C: sympy.geometry.Point, ID: str = 'X13', classes: list[str] | None = None, draw_equilaterals: bool = False) sympy.geometry.Point¶
Construct the 1st isogonic center (Fermat point)
X_13.
- geometor.etc.feuerbach_point(model: geometor.model.Model, A: sympy.geometry.Point, B: sympy.geometry.Point, C: sympy.geometry.Point, ID: str = 'X11', classes: list[str] | None = None, draw_circles: bool = False) sympy.geometry.Point¶
Construct the Feuerbach point
X_11of triangleABC.
- geometor.etc.first_isodynamic_point(model: geometor.model.Model, A: sympy.geometry.Point, B: sympy.geometry.Point, C: sympy.geometry.Point, ID: str = 'X15', classes: list[str] | None = None) sympy.geometry.Point¶
Construct the 1st isodynamic point
X_15.
- geometor.etc.first_napoleon_point(model: geometor.model.Model, A: sympy.geometry.Point, B: sympy.geometry.Point, C: sympy.geometry.Point, ID: str = 'X17', classes: list[str] | None = None) sympy.geometry.Point¶
Construct the 1st Napoleon point
X_17.
- geometor.etc.gergonne_point(model: geometor.model.Model, A: sympy.geometry.Point, B: sympy.geometry.Point, C: sympy.geometry.Point, ID: str = 'X7', classes: list[str] | None = None, draw_cevians: bool = False, draw_intouch: bool = False) sympy.geometry.Point¶
Construct the Gergonne point
X_7of triangleABC.
- geometor.etc.get_center_concordance(num: int) CenterConcordance | None¶
Return the
CenterConcordancefor centerX_num, if registered.
- geometor.etc.harmonic_feuerbach_point(model: geometor.model.Model, A: sympy.geometry.Point, B: sympy.geometry.Point, C: sympy.geometry.Point, ID: str = 'X12', classes: list[str] | None = None) sympy.geometry.Point¶
Construct
X_12(the{X_1, X_5}-harmonic conjugate ofX_11).
- geometor.etc.incenter(model: geometor.model.Model, A: sympy.geometry.Point, B: sympy.geometry.Point, C: sympy.geometry.Point, ID: str = 'X1', classes: list[str] | None = None, draw_bisectors: bool = False, draw_incircle: bool = False, draw_touchpoints: bool = False) sympy.geometry.Point¶
Construct the incenter
X_1of triangleABC(Euclid IV.4).- Parameters:
model – Target
geometor.model.Model.A – Vertices of reference triangle
ABC.B – Vertices of reference triangle
ABC.C – Vertices of reference triangle
ABC.ID – Element identifier (defaults to
"X_1").classes – Optional CSS/model classes.
draw_bisectors – When
True, constructs exact internal angle bisector feetI_a, I_b, I_cand concurring bisector lines[ A I_a ],[ B I_b ],[ C I_c ].draw_incircle – When
True, constructs the inscribed circleincirclecentered atX_1through exact tangency footT_c.draw_touchpoints – When
True, constructs all three right-spread touchpointsT_a, T_b, T_c.
- geometor.etc.isotomic_conjugate_of_incenter(model: geometor.model.Model, A: sympy.geometry.Point, B: sympy.geometry.Point, C: sympy.geometry.Point, ID: str = 'X75', classes: list[str] | None = None) sympy.geometry.Point¶
Construct
X_75, the isotomic conjugate ofX_1.
- geometor.etc.mittenpunkt(model: geometor.model.Model, A: sympy.geometry.Point, B: sympy.geometry.Point, C: sympy.geometry.Point, ID: str = 'X9', classes: list[str] | None = None) sympy.geometry.Point¶
Construct the Mittenpunkt
X_9of triangleABC.
- geometor.etc.nagel_point(model: geometor.model.Model, A: sympy.geometry.Point, B: sympy.geometry.Point, C: sympy.geometry.Point, ID: str = 'X8', classes: list[str] | None = None, draw_cevians: bool = False, draw_extouch: bool = False) sympy.geometry.Point¶
Construct the Nagel point
X_8of triangleABC.
- geometor.etc.nine_point_center(model: geometor.model.Model, A: sympy.geometry.Point, B: sympy.geometry.Point, C: sympy.geometry.Point, ID: str = 'X5', classes: list[str] | None = None, draw_circle: bool = False) sympy.geometry.Point¶
Construct the nine-point center
X_5of triangleABC.
- geometor.etc.orthocenter(model: geometor.model.Model, A: sympy.geometry.Point, B: sympy.geometry.Point, C: sympy.geometry.Point, ID: str = 'X4', classes: list[str] | None = None, draw_altitudes: bool = False) sympy.geometry.Point¶
Construct the orthocenter
X_4of triangleABC.
- geometor.etc.second_isodynamic_point(model: geometor.model.Model, A: sympy.geometry.Point, B: sympy.geometry.Point, C: sympy.geometry.Point, ID: str = 'X16', classes: list[str] | None = None) sympy.geometry.Point¶
Construct the 2nd isodynamic point
X_16.
- geometor.etc.second_isogonic_center(model: geometor.model.Model, A: sympy.geometry.Point, B: sympy.geometry.Point, C: sympy.geometry.Point, ID: str = 'X14', classes: list[str] | None = None) sympy.geometry.Point¶
Construct the 2nd isogonic center
X_14.
- geometor.etc.second_napoleon_point(model: geometor.model.Model, A: sympy.geometry.Point, B: sympy.geometry.Point, C: sympy.geometry.Point, ID: str = 'X18', classes: list[str] | None = None) sympy.geometry.Point¶
Construct the 2nd Napoleon point
X_18.
- geometor.etc.spieker_center(model: geometor.model.Model, A: sympy.geometry.Point, B: sympy.geometry.Point, C: sympy.geometry.Point, ID: str = 'X10', classes: list[str] | None = None, draw_circle: bool = False, draw_bisectors: bool = False, draw_medial: bool = False) sympy.geometry.Point¶
Construct the Spieker center
X_10of triangleABC.
- geometor.etc.symmedian_point(model: geometor.model.Model, A: sympy.geometry.Point, B: sympy.geometry.Point, C: sympy.geometry.Point, ID: str = 'X6', classes: list[str] | None = None, draw_symmedians: bool = False) sympy.geometry.Point¶
Construct the symmedian (Lemoine) point
X_6of triangleABC.
- geometor.etc.parse_center(html_content: str) dict[str, Any] | None¶
Parse a center’s HTML content into a rich structured dictionary.
- class geometor.etc.CenterSymbolicRegistry(triangle: geometor.etc.triangles.SymbolicTriangle | str = 'heronian', *, cache_dir: pathlib.Path | str | None = DEFAULT_SYMBOLIC_CACHE_DIR)¶
Exact symbolic evaluator and persistent cache for ETC triangle centers.
- Parameters:
triangle – A
SymbolicTriangleinstance or canonical preset name ("heronian","right","kepler","kimberling").cache_dir – Directory where per-triangle JSON cache files are stored. Pass
Noneto disable disk persistence (in-memory only).
- cache_dir¶
- property cache_file: pathlib.Path | None¶
Path to this triangle’s JSON cache file.
- evaluate_barycentrics(num: int, raw_bary: tuple[sympy.Expr, sympy.Expr, sympy.Expr] | None = None) SymbolicCenterRecord¶
Evaluate and cache a center from either
EXACT_CYCLIC_BARYCENTRICSorraw_bary.
- get(num: int) SymbolicCenterRecord¶
Return the exact
SymbolicCenterRecordforX_num.
- evaluate_cyclic_sympy(num: int, first_component: sympy.Expr, *, is_trilinear: bool = False, cache: bool = True) SymbolicCenterRecord¶
Evaluate an arbitrary cyclic SymPy expression in
(a, b, c, A, B, C, S_A, S_B, S_C, S, r, R, s).
- warm_collection_1() dict[int, SymbolicCenterRecord]¶
Evaluate and cache all Collection 1 centers (X1–X19) plus key companions.
- class geometor.etc.SymbolicCenterRecord¶
Exact symbolic coordinates and invariants for center
X_numon a triangle.- search_value: sympy.Expr¶
- classmethod from_cache_dict(data: dict[str, Any]) SymbolicCenterRecord¶
Deserialize exact SymPy expressions from
sp.sreprstrings.
- geometor.etc.generate_rst_files(centers: list[dict[str, Any]], output_dir: str | pathlib.Path, glossary_terms: dict[str, Any] | list[str] | None = None, preambles_by_center: dict[str, list[dict[str, Any]]] | None = None, valid_centers: set[int] | None = None, render_graphics: bool = True, constructions_dir: str | pathlib.Path | None = None) None¶
Generate thematic collection folders (c-XXXXX-YYYYY/) and per-center folders (x-NNNNN/).
- geometor.etc.CANONICAL_TRIANGLES: dict[str, SymbolicTriangle]¶
- class geometor.etc.SymbolicTriangle¶
Exact symbolic reference triangle with side lengths, vertices, and invariants.
- Parameters:
key – Preset identifier (
"heronian","right","kepler","kimberling", or"acute").label – Short human-readable title (e.g.
"Heronian (15, 13, 14)").field_latex – LaTeX string naming the ambient algebraic field (e.g.
r"\mathbb{Q}").a – Exact side lengths \(a = |BC|\), \(b = |CA|\), \(c = |AB|\).
b – Exact side lengths \(a = |BC|\), \(b = |CA|\), \(c = |AB|\).
c – Exact side lengths \(a = |BC|\), \(b = |CA|\), \(c = |AB|\).
A_xy – Exact Cartesian coordinates of vertices \(A\), \(B\), \(C\).
B_xy – Exact Cartesian coordinates of vertices \(A\), \(B\), \(C\).
C_xy – Exact Cartesian coordinates of vertices \(A\), \(B\), \(C\).
area – Exact area \(\Delta = \operatorname{Area}(\triangle ABC)\).
simplify_fn – Field-aware exact simplification callable.
- a: sympy.Expr¶
- b: sympy.Expr¶
- c: sympy.Expr¶
- area: sympy.Expr¶
- simplify_fn: collections.abc.Callable[[sympy.Expr], sympy.Expr]¶
- property Q_a: sympy.Expr¶
Exact quadrance \(Q_a = a^2\) of side \(BC\).
- property Q_b: sympy.Expr¶
Exact quadrance \(Q_b = b^2\) of side \(CA\).
- property Q_c: sympy.Expr¶
Exact quadrance \(Q_c = c^2\) of side \(AB\).
- property s: sympy.Expr¶
Exact semiperimeter \(s = (a + b + c)/2\).
- property two_area: sympy.Expr¶
Conway doubled area \(S = 2\Delta\).
- property r: sympy.Expr¶
Exact inradius \(r = \Delta / s\).
- property Q_r: sympy.Expr¶
Exact incircle quadrance \(Q_r = r^2\).
- property R: sympy.Expr¶
Exact circumradius \(R = abc / (4\Delta)\).
- property Q_R: sympy.Expr¶
Exact circumcircle quadrance \(Q_R = R^2\).
- property S_A: sympy.Expr¶
Conway symbol \(S_A = (b^2 + c^2 - a^2)/2\).
- property S_B: sympy.Expr¶
Conway symbol \(S_B = (c^2 + a^2 - b^2)/2\).
- property S_C: sympy.Expr¶
Conway symbol \(S_C = (a^2 + b^2 - c^2)/2\).
- unit_baseline() SymbolicTriangle¶
Return a homothetic copy scaled by \(1/c\) so \(A=(0,0), B=(1,0)\).
- trilinear_to_bary(alpha: sympy.Expr, beta: sympy.Expr, gamma: sympy.Expr) tuple[sympy.Expr, sympy.Expr, sympy.Expr]¶
Convert homogeneous trilinears \((\alpha : \beta : \gamma)\) to barycentrics.
- bary_to_trilinear(u: sympy.Expr, v: sympy.Expr, w: sympy.Expr) tuple[sympy.Expr, sympy.Expr, sympy.Expr]¶
Convert homogeneous barycentrics \((u : v : w)\) to trilinears.
- normalize_bary(u: sympy.Expr, v: sympy.Expr, w: sympy.Expr) tuple[sympy.Expr, sympy.Expr, sympy.Expr]¶
Normalize homogeneous barycentrics so \(u + v + w = 1\).
- bary_to_cartesian(u: sympy.Expr, v: sympy.Expr, w: sympy.Expr) tuple[sympy.Expr, sympy.Expr]¶
Map homogeneous barycentrics \((u : v : w)\) to exact Cartesian \((x, y)\).
- cartesian_to_sub_areas(x: sympy.Expr, y: sympy.Expr) tuple[sympy.Expr, sympy.Expr, sympy.Expr]¶
Return exact signed sub-triangle areas \((\Delta_a, \Delta_b, \Delta_c)\).
- kimberling_search_value(u: sympy.Expr, v: sympy.Expr, w: sympy.Expr) sympy.Expr¶
Return exact directed distance \(h_a = 2\Delta u / (a(u + v + w))\) to \(BC\).
- geometor.etc.get_canonical_triangle(preset: str = 'heronian', *, unit_baseline: bool = False) SymbolicTriangle¶
Return a canonical
SymbolicTriangleby preset key.- Parameters:
preset – One of
"heronian","right","kepler","kimberling"(or legacy"acute").unit_baseline – When
True, scales the triangle by \(1/c\) so \(AB = 1\).