How donrudd/pointtoellipse works
This repository is a small numerical demo for projecting a point onto a parametrically defined ellipse. It offers two independent approaches: an analytic tangent-half-angle polynomial solve and an iterative gradient-descent method. Each script also visualizes its result. The scripts use hard-coded example inputs rather than exposing a separate application interface; the graph shows the computational and plotting responsibilities in those files.
Main entry points: Analytical.py Analytic plot · GradientDescent.py Gradient plot
Components 12
Analytic method
- Projection solver
Analytical.py - Polynomial roots
- Tangent direction
Analytical.py
Iterative method
- Distance objective
GradientDescent.py - Finite difference
GradientDescent.py - Backtracking descent
GradientDescent.py
Visualization
- Analytic plot
Analytical.py - Ellipse geometry
GradientDescent.py - Tangent direction
GradientDescent.py - Gradient plot
GradientDescent.py
Other components
- Script runner
- Plotting library
Connections 12
- Script runner → Projection solver: runs script
- Projection solver → Polynomial roots: solves polynomial
Analytical.py - Analytic plot → Projection solver: gets projection
Analytical.py - Analytic plot → Tangent direction: gets tangent
Analytical.py - Analytic plot → Plotting library: draws result
Analytical.py - Script runner → Backtracking descent: runs script
- Backtracking descent → Finite difference: estimates slope
GradientDescent.py - Finite difference → Distance objective: samples distance
GradientDescent.py - Backtracking descent → Distance objective: tests steps
GradientDescent.py - Gradient plot → Ellipse geometry: computes ellipse
GradientDescent.py - Gradient plot → Tangent direction: gets tangent
GradientDescent.py - Gradient plot → Plotting library: draws result
GradientDescent.py