Project 15: Conic Sections Mapper
A self-contained deep-dive from the canonical Math from Foundations to Machine Learning curriculum.
- Difficulty: Intermediate-Advanced
- Time: 10-18 hours
- Language: Python (alternatives: Julia, JavaScript, C#)
- Prerequisites: Projects 3 and 5
- Source:
HS P15
What You Will Build
Build a conic-analysis tool for axis-aligned general quadratic equations Ax^2 + Cy^2 + Dx + Ey + F = 0. Parse and normalize coefficients, classify circles, ellipses, parabolas, hyperbolas, and degenerate/unsupported cases, then complete the square to produce standard form. Extract center or vertex, axes/radius, orientation, foci, directrix where appropriate, and asymptotes for hyperbolas. Plot the curve from the derived geometry and verify the transformation by sampling points and checking residuals in both original and standard equations.
Real World Outcome
For 4x^2 + 9y^2 - 8x + 36y + 4 = 0, the report shows each completing-the-square step, identifies an ellipse, prints its center and semi-axes, and saves a correctly scaled plot with foci. Invalid, degenerate, imaginary, or rotated Bxy cases are classified explicitly rather than forced into a misleading picture.
Core Question
How does the algebraic pattern of a quadratic equation encode the geometry of a circle, ellipse, parabola, or hyperbola?
Concepts You Must Understand First
- Completing the square: rewrite
ax^2 + bxas a shifted square plus a constant. - Standard conic forms: signs and denominators determine shape and scale.
- Geometric parameters: center/vertex, axes, eccentricity, foci, directrices, and asymptotes.
- Quadratic-form viewpoint: coefficients summarize curvature; an
xyterm indicates rotation. - Residual checks: derived points should satisfy the original equation within tolerance.
Build Milestones
- Parse two-variable quadratic expressions into stable coefficient records.
- Classify supported axis-aligned forms and detect degenerate, empty, or rotated cases.
- Generate completing-the-square steps and normalized standard form.
- Extract geometric parameters and render equal-aspect plots with meaningful bounds.
- Sample the plotted parameterization and verify original-equation residuals.
Hints in Layers
- Group x terms, y terms, and constants before completing either square.
- Normalize the final right-hand side to
1, then read denominators and signs structurally. - Derive plotting bounds from center/axes rather than using an arbitrary window.
Common Pitfalls and Debugging
- Symptom: ellipses look circular. Cause: unequal plot-axis scaling. Fix: enforce equal aspect ratio.
- Symptom: a negative-radius circle is plotted. Cause: empty/imaginary cases were not classified after normalization. Fix: validate squared-length parameters before plotting.
- Symptom: completing-square steps change the curve. Cause: constants added inside groups were not balanced outside. Fix: track symbolic before/after coefficients and residual-test samples.
Definition of Done
- Supported quadratic inputs classify correctly, including degenerate/empty cases.
- Standard-form transformations are shown and algebraically equivalent.
- Geometry tables include the appropriate parameters for each conic.
- Plots use equal scaling and derived, reproducible bounds.
- Sampled plotted points satisfy the original equation within tolerance.
Navigation
Previous: Project 14 · Complete learning path · Next: Project 16