bool FlatEllipse::intersect_extended(const FlatPoint &pe, FlatPoint &i1, FlatPoint &i2) const { const FlatLine l_f1p(f1, pe); const FlatLine l_pf2(pe, f2); const Angle ang = l_f1p.angle(); const fixed d = l_pf2.d() + max(a, b); // max line length fixed can, san; ang.sin_cos(san, can); FlatLine e_l(pe, FlatPoint(pe.x + d * can, pe.y + d * san)); // e_l is the line extended from p in direction of f1-p return intersect(e_l, i1, i2); }
bool FlatEllipse::IntersectExtended(const FlatPoint &pe, FlatPoint &i1, FlatPoint &i2) const { const FlatLine l_f1p(f1, pe); const FlatLine l_pf2(pe, f2); const Angle ang = l_f1p.angle(); const fixed d = l_pf2.d() + std::max(a, b); // max line length const auto sc = ang.SinCos(); fixed san = sc.first, can = sc.second; FlatLine e_l(pe, FlatPoint(pe.x + d * can, pe.y + d * san)); // e_l is the line extended from p in direction of f1-p return Intersect(e_l, i1, i2); }