Function ellipse_line_intersection

Source
pub fn ellipse_line_intersection(a: f64, b: f64, m: f64) -> Point
Expand description

\returns the intersection point for a line with slope \p m with an ellipse with the formula. 1 = (x^2 / a^2) + (y^2 / b^2). Replace Y with the line equation and isolate x and solve to get the intersection point with the ellipse. Notice that a line has two intersection points with a circle, so users need to figure out which of the two values (+X, +Y) or (-X, -Y) is relevant.