Skip to content

pallosp/conic_research_sympy

Repository files navigation

Calculating with conics (research project)

This project provides a symbolic framework for working with classic Euclidean and projective geometry in 2D. Built on top of SymPy, it offers tools to construct, transform, and analyze geometric entities such as points, lines, and conics in projective space.

The API supports:

  • Conic representation in quadratic and polar forms
  • Constructing conics from 5 points, focus/directrix, center/radii, and more
  • Line and point operations including bisectors, parallels, perpendiculars, etc.
  • Geometric transformations like translation, scaling, and rotation in projective space
  • Conic classification (e.g., ellipse, parabola, hyperbola, degenerate)
  • Distance computations

The library is based on foundational projective geometry principles, with several algorithms adapted from Jürgen Richter-Gebert’s Projective Geometry book. It's useful for symbolic computations, educational purposes, and geometric reasoning.

Complete API reference

Development

Installation

git clone https://github.com/pallosp/conic_research_sympy
python3 -m venv .venv
source .venv/bin/activate
pip install -e '.[dev]'

Useful commands

Regenerating the API docs:

pydoc-markdown

Running the tests (with optional coverage report):

pytest

pytest --cov src/lib --cov-report html
open htmlcov/index.html

Running the linter (with optional auto-fixes):

ruff check
ruff check --fix

Running all pre-commit checks for the staged files:

pre-commit

Releases

No releases published

Packages

No packages published