# Project a parabolic curve to straight lines.

I am working with Voronoi Diagrams and I'm given a parabolic curve that is described through four parameters:

• A start point, say $$P_0(x_0,y_0)$$.
• An end point, say $$P_1(x_1,y_1)$$.
• A focus point, say $$F(x_f,y_f)$$.
• And a directrix line $$l$$, say from point $$L_0$$ to $$L_1$$. Instead of calculating the parabola points (as in the Wiki), I'd like to find a third point, let's say $$C$$, that creates two straight lines (e.g. horizontal and vertical) between $$P_0$$ and $$P_1$$, such that it "follows" the curve. For example, for the following image, if $$P_0 = (3,3)$$ and $$P_1 = (5,1)$$, then I want to find $$C = (3,1)$$.

I was looking into Bezier curves, but it does not seem to fulfill my needs. The control point seems to depend on the curvature of the parabola, thus it might not give the straight lines I seek.

Is there a proper way to calculate such a point? EDIT: For the figure above there are two possible solutions to connect $$P_0$$ to $$P_1$$ with two straight lines (i.e. horizontal or vertical). Either we go east then south; or south then east. Following the curve means the later solution is the one I am seeking because it somewhat follows the parabola. I could say point $$C$$ is farthest from the focal point; but rather than this simple algorithm I would like to know if there's a more robust and mathematical definition for such point, such as Bezier Curves. You could this simply does not exist and that would be a valid solution. Brainstorming: I've thought about using the tangent crossing (as in the comments below) but they don't yield the exact point I need as they depend on the slope. I've also thought about interpreting this parabola as part of a circle and computing the tangent crossings, but, intuitively, that seems to run into the same problem.

• You say that point $C$ "follows the curve" : what do you mean by that ? Are you still thinking to curves more or less in the "Bezier family" ? Feb 8, 2022 at 23:29
• Exactly. In the example, both $C$ equal to $(3,1)$ or $(5,3)$ would form a straight line between($P0$, $C$, and $P1$). Only the first, however, would "follow the curve". Feb 8, 2022 at 23:44
• Therefore, why not taking tangents to the parabola in points $P_0,P_1$ and take their point of intersection (giving a classical Quadratic Bezier...) Feb 9, 2022 at 10:03
• I thought the tangents might yield non-horizontal/vertical lines for the parabola (Wiki example). Feb 9, 2022 at 16:38

As far as I can see, your question is not related to the parabola. You have two points, $$P_0 =(x_0, y_0)$$ and $$P_1 = (x_0, y_0)$$, and you want to construct a third point, $$C = (C_x, C_y)$$. The coordinates of $$C$$ are given by $$C_x = \min(x_0, x_1)$$ and $$C_y = \min(y_0, y_1)$$.

But perhaps I’m not correctly understanding what you mean by “follows the curve”. If you can give a better definition of that term, then the folks here can give you a better answer.

Edit (after you improved the question)
There are only two choices for the point $$C$$. I described one of them above. The right choice of $$C$$ depends on whether the parabola lies above or below the line $$P_0P_1$$. So, take the mid-point of the parabola (or some other convenient point lying on the parabola) and check whether it lies above or below the line $$P_0P_1$$.

If above, then $$C_x = \max(x_0, x_1)$$ and $$C_y = \max(y_0, y_1)$$.

If below, then $$C_x = \min(x_0, x_1)$$ and $$C_y = \min(y_0, y_1)$$.

• We could define following the curve as third point $P_2$ whose triangle ($P_0, P_1, P_2$) would contain the curve within it. Intuitively, to connect two points $P_0$ and $P_1$ with straight lines only (horizontal/vertical) I have two options (see question edit). I want to find the option that follows the same directions as the curve. Feb 14, 2022 at 13:06
• That's what I've got implemented. I was looking for a direct approach, such as $C = formula(P_0, P_1, F, L)$. That doesn't exists though. Thanks for brainstorming. Feb 16, 2022 at 13:19

Since you want to connect horizontal and vertical lines to $$P_0$$ and $$P_1$$, you have only two choices of where to place the point $$C.$$

All of the points on the parabolic arc from $$P_0$$ to $$P_1$$ will lie on the same side of the line $$P_0P_1.$$

Choose any point on the arc. Determine which side of the line it lies on. Choose the candidate for point $$C$$ that lies on the same side of the line.