That is the math behind interpolating circle using Bezier curve
bezier-curve
This is a basic circle build by a graphic editor using Bézier spline. The X here is 0.552125R:
But how this value had been gotten? I mean reverse engineering, the mathematical equation which results to this value
Best Answer
Suppose we have a smooth function
$$\begin{align}
f: [t_0, t_1] &\;\to\; \Bbb R^2 \\
t &\;\mapsto\; (x(t),\,y(t)) \\
\end{align}$$
that we want to approximate by means of a cubic Bézier curve $b=b_{[P0,P1,P2,P3]}$ where the $P_i$ are the so called control points:
A reasonable choice for the control points is then:
$$\begin{align}
P_0 &= f_0\\
P_1 &= f_0 + \alpha \cdot \dot f_0\\
P_2 &= f_1 - \beta \cdot \dot f_1\\
P_3 &= f_1\\
\end{align}$$
where $f_i = f(t_i)$ and similar notation for the derivatives.
The 1st and 4th equation mean that $b$ and $f$ have the same starting point and the same end point.
The 2nd and 3rd equation mean that $b$ is tangent to $f$ in the starting point and in the end point.
This means we have still a 2-dimensional space from which we can chose $b$, which is parameterized by the two parameters $\alpha$ and $\beta$. Now there are different approaches to narrow down these two parameters; one of which is to pick a point $Q\in f$ and require $b$ to run through $Q$.
The usual parametrization of the unit circle is $f(t) = (\cos t, \sin t)$ which traverses the circle at constant speed. So we chose $Q = f(t_{1/2}) = (1,1)/\sqrt{2}$.
Adding the requirement that $Q = f_t \stackrel!= b(t)$ to the 4 conditions from above yields the following linear system for $\alpha$ and $\beta$:
Solving that system is straight forward, and with $t = 1/2$ the solution reads
$$
\binom \alpha\beta = \frac 43\, \frac{1}{\dot x_1\dot y_0 - \dot x_0\dot y_1} \binom{\dot y_1 \quad -\dot x_1}{\dot y_0 \quad -\dot x_0}
\binom{x_0+x_1-2x_{1/2}}{y_0+y_1-2y_{1/2}}
$$
Plugging in values according to $f$ being a quarter of the unit circle, finally yields
Notice: As I said above, there is more than one way to approach this. A different way would be to require that the distance between $f$ and $b$ be minimal, like
$$ \max_t |f(t)-b(t)| \stackrel!= \text{minimal} $$
One problem is that $f$ and $b$ are traversed at diferent speeds, so that the $b$ you'll get from this is not the best one. Anyway, with almost certainty you'll get different control points $P_1$ and $P_2$ an thus a different value for your $x$.
This page gives the formula for arclength calculation. It covers the 3D case, but you can recover the 2D case just by ignoring $z$, of course. The formula involves an integral that can't be represented analytically. You can use any numerical integration technique you like, of course. The same page has a simple implementation of evaluation using Simpson's rule.
You should stick with the parametric form. Converting to $y = f(x)$ form is impossible, in general.
I'm not 100% sure what you're asking, but I think you're interested in finding the maximum extents of the curve in the $y$-direction. If so, you can certainly do this analytically, without any iterative calculations.
Suppose we let
$$
a = \text{the y-coordinate of } P_0 \text{ and } P_1
$$
$$
b = \text{the y-coordinate of } P_2 \text{ and } P_3
$$
$$
c = \text{the y-coordinate of } P_4 \text{ and } P_5
$$
Then the equation of the $y$-coordinate of the curve is
$$
y(t) = a(1-t)^5 + 5at(1-t)^4 + 10bt^2(1-t)^3 + 10bt^3(1-t)^2 + 5ct^4(1-t) + ct^5
$$
Differentiating and simplifying, we get
$$
y'(t) = 20t(t-1)\left[ (a-c)t^2 +2(b-a)t +a - b\right]
$$
The maximum you seek occurs where $y'(t)=0$, of course.
From above, we can see that this happens when $t=0$, or when $t=1$, or when $t$ is a root of the quadratic inside the square brackets. So, the real key to finding the maximum is finding the roots of the quadratic, which I expect you know how to do. Then you have to do the usual tests on the sign of $y''$ to figure out which roots correspond to maxima and which are minima.
Note that we have made no use of the $x$-coordinates of the control points -- they are irrelevant.
Best Answer
Suppose we have a smooth function $$\begin{align} f: [t_0, t_1] &\;\to\; \Bbb R^2 \\ t &\;\mapsto\; (x(t),\,y(t)) \\ \end{align}$$ that we want to approximate by means of a cubic Bézier curve $b=b_{[P0,P1,P2,P3]}$ where the $P_i$ are the so called control points:
$$\begin{align} b(t) &= (1-t)^3 P_0 + 3(1-t)^2t P_1 + 3(1-t)t^2 P_2 + t^3 P_3 \end{align}$$
A reasonable choice for the control points is then:
$$\begin{align} P_0 &= f_0\\ P_1 &= f_0 + \alpha \cdot \dot f_0\\ P_2 &= f_1 - \beta \cdot \dot f_1\\ P_3 &= f_1\\ \end{align}$$ where $f_i = f(t_i)$ and similar notation for the derivatives.
The 1st and 4th equation mean that $b$ and $f$ have the same starting point and the same end point.
The 2nd and 3rd equation mean that $b$ is tangent to $f$ in the starting point and in the end point.
This means we have still a 2-dimensional space from which we can chose $b$, which is parameterized by the two parameters $\alpha$ and $\beta$. Now there are different approaches to narrow down these two parameters; one of which is to pick a point $Q\in f$ and require $b$ to run through $Q$.
The usual parametrization of the unit circle is $f(t) = (\cos t, \sin t)$ which traverses the circle at constant speed. So we chose $Q = f(t_{1/2}) = (1,1)/\sqrt{2}$.
Adding the requirement that $Q = f_t \stackrel!= b(t)$ to the 4 conditions from above yields the following linear system for $\alpha$ and $\beta$:
$$\begin{align} &\binom{x_t-x_0}{y_t-y_0} + (2t^3-3t^2)\binom{x_1-x_0}{y_1-y_0} \\&\qquad\qquad= 3t(1-t)\binom{(1-t) \dot x_0 \quad -t \dot x_1}{(1-t) \dot y_0 \quad -t \dot y_1}\binom \alpha\beta \end{align}$$
Solving that system is straight forward, and with $t = 1/2$ the solution reads $$ \binom \alpha\beta = \frac 43\, \frac{1}{\dot x_1\dot y_0 - \dot x_0\dot y_1} \binom{\dot y_1 \quad -\dot x_1}{\dot y_0 \quad -\dot x_0} \binom{x_0+x_1-2x_{1/2}}{y_0+y_1-2y_{1/2}} $$ Plugging in values according to $f$ being a quarter of the unit circle, finally yields
$$ \alpha=\beta=\frac43(\sqrt2-1) \approx 0.55228475 $$
which is what you found by reverse engineering.
Notice: As I said above, there is more than one way to approach this. A different way would be to require that the distance between $f$ and $b$ be minimal, like
$$ \max_t |f(t)-b(t)| \stackrel!= \text{minimal} $$ One problem is that $f$ and $b$ are traversed at diferent speeds, so that the $b$ you'll get from this is not the best one. Anyway, with almost certainty you'll get different control points $P_1$ and $P_2$ an thus a different value for your $x$.