Find the function of separation between two functions

I seriously doubt that is what it is actually called, but I'm not very knowledgeable in this matter.

Conceptually, what I am trying to do is calculate the function of a line/curve that shows the divide between two other functions. As a visual example:

visual example

$$Red: f(x) = x^2 + 2$$ $$Blue: g(x) = -(x-3)^2$$

The orange curve would be some function $h(x)$, where all points on one side of the function would be nearest $f(x)$ and all points on the other side would be nearest $g(x)$. I would like to find a way to figure out what $h(x)$ is.

I'm sure something like this already exists, but I don't even know what to google to find out. I'd also like to mention that I'm looking for a general solution, not something specific to quadratic functions.

Thanks in advance.


Solution 1:

When I first read your question I thought that is simple you just wanted the vertical mean of the functions f(x) and g(x) at point x

h(x) = (f(x) + g(x)) / 2

But looking at your graph example it seems like you want h(x) to be such that the distance to any point f(y) on the f curve and the distance to any point g(z) on the g curve are equal.

This seems similar to the problem of creating an international boundary at sea between two countries where the boundary is equidistant from the land in each country. Using the equidistance principle http://en.wikipedia.org/wiki/Equidistance_principle is what I think you want.

I searched for the math on how to calculate such a line and the best I found was this article http://en.wikipedia.org/wiki/Equidistant

Hope this helps give you some ideas on solution