Perspectives on Projective Geometry: A Guided Tour Through Real and Complex Geometry

Category: Mathematics
Author: J├╝rgen Richter-Gebert
4.0
This Month Stack Overflow 1

Comments

by anonymous   2017-08-20

Depends on whether you're interested in approximate or in exact solutions (up to double precision). For approximate ones, you could simply parametrize the curves as some function f(t) and then do some interval nesting to find values for t which minimize the distance between the curves.

For exact solutions, you'd have to find the four points where two conic sections intersect. There is a short paragraph about this on wikipedia. The book Perspectives on Projective Geometry has a longer section explaining the details. There certainly are implementations available for various languages; the one for Asymptote comes to my mind just now. The implementation for its general case looks quite frightening, though, so it might be they are doing something overly complicated there.

Once you have all four points of intersection, you'd still have to decide which of them are on the part of the conic section delimited by the endpoints of your QuadCurve, but that should be simple in comparison. So in total, you'd have these three steps:

  1. Compute matrix of conic sections section from endpoints and control points
  2. Intersect conic sections using degenerat elements in their pencil
  3. Decide whether these intersections lie between the endpoints

If you have a problem with the mathematical details of one of these steps, it might be better to ask on the mathematics stack exchange. Not only have people there more experience with solving mathematical problems, the MathJax features for typesetting math will make the answers far more readable than an answer here could hope to be.

As to your note 2 about the straight line: that is easier by far, because if you express that problem in terms of coordinates, you'd only end up with a quadratic equation, instead of an equation of degree 4 for the naive approach to the general problem, and still degree 3 if you solve it as described by the above references. One can write the general aproach in such a way that intersecting a conic with a line is a step in the solution, so having a method for this might work well enough.