[Math] Finding $y$ coordinate given $x$ coordinate of cubic bezier curve under restrictions over control points

bezier-curvecubics

Given a cubic bezier curve,

$P(t) = P_0(1-t)^3 + 3P_1t(1-t)^2 + 3P_2 t^2(1-t) + P_3 t^3$

where $P(t) = (x(t), y(t))$ and $P_i = (x_i, y_i)$.

$P_0$ and $P_3$ are end points and $P_1$ and $P_2$ are control points.

Assume that $P_0 = (0,0)$ and $P_3 = (K,K)$ for some $K \in \mathbb{R}^+$. $P_1$ and $P_2$ are constrained to lie in the square defined by $P_0$ and $P_3$ as opposite ends of its diagonal.

I have the $x(t)$ coordinate, say $x^*$. The problem is to find an explicit equation for the corresponding $y(t)$ in terms of $x^*$. This means that I want a function $g$ in $x$ only such that $y^* = g(x^*)$.

I am hoping that with the constraints on the control points an explicit equation can be derived for $y$ given $x^*$.

EDIT: We know $P_1$ and $P_2$.

Thanks.

Best Answer

I think deletoin $t$ beween $$x=3x_1t(1-t)^2+3x_2t^2(1-t)+kt^3$$ and $$y=3y_1t(1-t)^2+3y_2t^2(1-t)+kt^3$$ is very difficult, for power 3. As you see here

fixed $x_1$ and $x_2$

with changing $y_1$ and $y_2$ we have a family of curves which give us a differential equation. I think finding an equation of $x(t)$, $y(t)$, $y_1$ and $y_2$ with fixed $x_1$ and $x_2$ is impossible. In this case by deletion $y_1$ or $y_2$, differential equation is of first order and if delete both of them, so differential equation is of second order. Fnding Envelope maybe useful here.

I think add an extra point or ordain extra conditions, like condition on slops, areas, etc it will be possible to find an explicit solution. Otherwise numerical method should provide approximation solutions.