[Math] Offsetting a curve in 2D

analytic geometry

I'd like to "move" a curve $d$ (offset) units "up" (actually in the sense that the perpendicular distance between the curves is always constant). The objective is to create a channel that has constant width. I want the shape of the second curve such that the shortest distance to the first curve is the same everywhere. Here's a picture to better illustrate what I want. (sorry for the bad drawing)

enter image description here

I've pinpointed the relevant points on the curves.

The lower curve (the one nearer the x axis) I have all the points (x and y coordinates). It's actually composed out of 5 points and 2 curves. The first curve is composed of the two most bottom left points I have drawn and one at the middle of the curve (which I have not drawn). The other curve that connects to it doesn't matter.

The point I'd like to calculate is the the only point I've shown on the higher curve.
I can calculate:
$$α = arctan(d / \text{[distance between the two most bottom left points]})$$
$β$ can also be as easily calculated. Still this doesn't seem to help me much to get the coordinates of the point I want. Am I approaching this wrong? Thanks in advance.

Best Answer

If your original curve is given in parameter form, i.e. if you have a function $f_1: [a,b] \rightarrow \mathbb{R}^2$ such that your original curve is set of points $\{f_1(t) : t \in [a,b]\}$, then the second curve, also in parameter form, is simply $$ f_2(t) = f_1(t) + d\begin{pmatrix} 0 & 1 \\ -1 & 0 \end{pmatrix}\frac{f_1'(t)}{|f_1'(t)|} $$ $f'_1(t)$ denotes the derivative of $f$ at $t$. This thus basically says that to get $f_2(t)$, you start at $f_1(t)$, determine the direction of the $f_1$ at $t$ (which is $f_1't(t)$), normalize that vector, rotate by $90$ degree, and scale by $d$ (which is the desired distance between $f_1$ and $f_2$).

Note that this will only work if $d$ is less than the maximal curvatur of $f$. Otherwise, $f_2$ will intersect itself.