14

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.

Abion47
  • 263
  • If anyone wants to mess around with a graph, here: https://www.desmos.com/calculator/bvrekoymb5 – Conor O'Brien May 08 '15 at 02:27
  • @CᴏɴᴏʀO'Bʀɪᴇɴ That is the exact site I used to draw up the image for the example (sans h(x), which I drew in manually). To clarify, though, I'm not looking for a solution to this specific pair of functions. – Abion47 May 08 '15 at 03:05
  • 1
    Obviously many different separating functions $h$ are possible. A pretty simple one would be $h(x) = \frac{f(x) + g(x)}{2}$. This $h$ at least has a name, it is the average of $f$ and $g$. – Mike F May 08 '15 at 06:09
  • @MikeF At first glance this strikes me as an ideal solution, but upon further pondering I wonder if there would be a case where a point would be under $h$ in the y direction and thus "closer" to $f$, but technically closer to $g$ in some direction other than vertical? Would such a concern even matter? – Abion47 May 08 '15 at 09:06
  • @Abion47: I guess you need to decide more precisely what you mean by a separating function. As you say, the average is precisely halfway between them in the vertical direction, but perhaps not by other measures of "halfway between". – Mike F May 08 '15 at 17:28
  • @Abion47 Oh lol that makes sense :P How'd you draw the line? MS Paint or something? – Conor O'Brien May 09 '15 at 01:25
  • @MikeF Like I said, I want to figure out how to find a function $h$ where all points on one side of the function are closest to $f$ and on the other are closest to $g$. The best way I could think to explain it would be for the line to form halfway between the functions' normals. – Abion47 May 09 '15 at 05:52
  • @CᴏɴᴏʀO'Bʀɪᴇɴ I drew it on with PaintTool SAI. – Abion47 May 09 '15 at 05:52
  • $ \ arg \ min_ {p,q} \int (p-x)^2+ (q-f(x))^2 + (p-x)^2 + (q-g(x))^2 dx $ . Does this fit your definition ? – SagarM May 03 '20 at 15:13

1 Answers1

2

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

  • 1
    I think you want to go one wikipedia link further to https://en.wikipedia.org/wiki/Equidistant_set which already gives some examples of equidistant curves between two other objects. – quarague Feb 11 '20 at 10:53