2

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} $$

vallev
  • 81

2 Answers2

1

A toy constructed in MATHEMATICA which giving two curves in parametric representation, try to calculate the specular curve (in red) for g[t] (in green) having as mirror f[t] (in blue). The calculations are rather simple.

Clear[f, g]
f[t_] := 2 {2 Cos[t], Sin[t]}
g[t_] := {Cos[t]/5, Sin[t]}
Clear[f, g]
f[t_] := {-4 t^3, 1/2 + 3 t^2}
g[t_] := {t, t^2}
Clear[f, g]
a = 1; b = 2;
f[t_] := {a Cos[t], b Sin[t]}
g[t_] := (a^2 - b^2)/(a b) {b Cos[t]^3, -a Sin[t]^3}

Clear[especular] especular[f_, g_, range_] := Module[{t, n, sol, pg, data = {}, lambda, equs, ps, tk, tau, sols}, For[tk = range[[1]], tk <= range[[2]], tk += range[[3]], n = D[f[t], t, t]; equs = (f[t] + lambda n - g[tau]) /. {t -> tk}; sols = Sort[{lambda, tau} /. Quiet@Solve[equs == 0, {lambda, tau}, Reals] /. {C[1] -> 0}]; pg = g[tau] /. Thread[{lambda, tau} -> sols[[1]]]; ps = (f[t] - lambda n) /. Thread[{lambda, tau} -> sols[[1]]] /. {t -> tk}; AppendTo[data, ps] ]; Return[data] ]

data = especular[g, f, {-Pi, Pi, 0.01}]; gr1 = ParametricPlot[f[t], {t, -Pi, Pi}, PlotStyle -> Blue]; gr2 = ParametricPlot[g[t], {t, -Pi, Pi}, PlotStyle -> Green]; gr3 = ListLinePlot[data, PlotStyle -> Red]; Show[gr1, gr2, gr3, PlotRange -> {{-6, 6}, {-6, 6}}, Axes -> False]

The specularparameters are f is the function $f(t)$ name, g is the function $g(t)$ name, and range is a list with three values: $\{t_{min},t_{max}, \Delta t\}$. Follows a plot showing the case

$$ \cases{ f(t) = \{a\cos t, b\sin t\}\\ g(t) = \frac{a^2-b^2}{a b}\{b\cos^3 t,-a\sin^3 t\}, a = 1, b = 2\\ t_{min}= -\pi, \ t_{\max} = \pi, \ \Delta t = 0.01\\ } $$

enter image description here

enter image description here

Cesareo
  • 33,252
  • 1
    You may add the curves are evolutes, so solving the equation for their intersection with a line is simpler – Тyma Gaidash Dec 10 '23 at 22:57
  • 1
    As I said, it is a toy that will try to solve the proposed problem. Non parametric versions can be programed also. I have one but is quite messy to explain. – Cesareo Dec 10 '23 at 23:04
0

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.

Eric
  • 6,348