Does anyone know how to calculate the medial axis for two given curves?
Medial axis: http://en.wikipedia.org/wiki/Medial_axis
Here is the shape I need to calculate it for:

I drew in the medial axis myself, the dark black line, but I need to be able to calculate it dynamically.
Here is the applet and code of what I have done so far: http://www.prism.gatech.edu/~jstrauss6/3451/sample/
The known variables are: -pt A, B, C, D -radii of red, green, and black circles -pt Q and R (just outside the picture), the black circles.
Let
C1andC2be centers of circles with radiir1andr2. The medial axis (minus the two center points) of the figure made of the two circles is the set of pointsMsatisfyingwhich implies
so the medial axis is a fourth degree algebraic curve.
Let us say that
C1andC2are on the y axis, and suppose that the point (0,0) lies on the medial axis (soC1 = (0, -r1 - x)andC2 = (0, r2 + x)for somexyou can compute from your data). This is something you can always transform into.Now, you want the curve
y = f(x)which parametrizes the median axis. For this, pick thexof your choice, and solve equation(**)inywith Newton's method, with initial guessy = 0. This is a polynomial you can compute exactly, as well as its derivative (iny).