Question: What is the best way to describe the set of reflected points of one plane curve along the perpendicular lines at points of another plane curve?
I am trying to find a way to find the reflection of a curve onto another.
Here is a Desmos graph to visualize the setup https://www.desmos.com/calculator/wpbzb9hm1b
Some background:
In college algebra, one learns that the inverse $g^{-1}(x)$ of a function $g(x)$ is found geometrically to be the reflection of $g(x)$ along the line $y=x$. This makes intuitive sense, because we are swapping inputs with outputs.
Reflecting a line onto another may not necessarily yield a function. But that shouldn't stop us from drawing it. I have not seen anyone do it anywhere else.
Let $f(x)$ be the function we wish to use for reflection, and $ g(x) $ the function we wish to reflect. The procedure is as follows: first, we identify a point in $ (a, f(a)) $ and draw a line perpendicular to $f(x)$ at $a$ . This line intersects $g(x)$ at some point $(x_0, g(x_0))$ (it is possible that this line intersects at multiple points, but, for now, let's take the closest). We measure the distance $ d $ between these points, and use it to draw the point $ (x_h, h(x_h)) $ that is $ d $ units away from $ (a, f(a)) $ on the opposite side of the line perpendicular to $ f(x) $.
If $ f(x) $ is differentiable and $ f'(a) \neq 0 $, the perpendicular line at $ (a, f(a)) $ has the slope $ -\frac{1}{f'(a)} $. The direction vector for this line is $ (1, -\frac{1}{f'(a)}) $ or any scalar multiple thereof. The equation for the line perpendicular to $ f(x) $ at $ (a, f(a)) $ is:
$$ y = -\frac{1}{f'(a)}(x - a) + f(a) $$
For $ g(x) $ to intersect this line, it must satisfy the equation. Let's call the intersection point $ (x_0, g(x_0)) $. We can find $ x_0 $ by solving the equation:
$$ g(x_0) = -\frac{1}{f'(a)}(x_0 - a) + f(a) $$
Once $ x_0 $ is found, $ g(x_0) $ is simply the value of $ g(x) $ at $ x_0 $.
The distance $ d $ is calculated using the distance formula: $$ d = \sqrt{(x_0 - a)^2 + (g(x_0) - f(a))^2} $$


First, thinking of them as functions is just going to lead to extra complications, especially since the reflection (just like the inverse) might not be unique along every fixed value of $x$. Instead, it’s conceptually nicer to think of them as parametrized curves: $x \rightarrow (x,g(x))$.
Let’s call the functions $F(x)=(x,f(x))$ and $G(x)=(x,g(x))$. Let $t(x)$ be such that $F(t(x))$ is the closest point on $F$ to $G(x)$. If $F$ is smooth then $F’(t)$ would be perpendicular to $F(t)-G(x)$, so it could be computed as the closest of the solutions to $G(x)$ of the equation $F’(t(x)) \cdot (F(t(x))-G(x))=0$.
Then, now that you have the projected curve $F(t(x))$, the reflection is just traveling more in the same direction, so the reflection is $F(t(x))+(F(t(x))-G(x))=2F(t(x))-G(x)$.
Despite this being conceptually simple, it’ll probably be pretty messy to compute in practice for complicated functions.
Here’s an example computation for a reflection around $y=x$, i.e. when $F(x)=(x,x)$
Then, we need to solve $F’(t) \cdot (F(t)-G(x))=0$, so $(1,1)\cdot (t-x,t-g(x))=0$, so $2t-x-g(x)=0$, $t=(x+g(x))/2$ and the projection of $(x,g(x))$ is $((x+g(x))/2,(x+g(x))/2)$ with reflection $2F(t)-G(x)=(g(x),x)$ as would be expected.