Cubic Bezier curve mapping to a segment of a curve that is y = sin(fx)

80 Views Asked by At

I've seen [1] Getting the most accurate bezier curve that plots a sine wave

and [2] Can a rational Bézier curve take exactly the same shape as a part of the sine function?

but neither actually answer my question which is...

I have a curve that is $y = \sin(f(x))$.

I am only interested in addressing a part of that curve where $x$ is between $x_0$ and $x_3$. The range for x is constrained such that $|x_3-x_0| \le \pi$. [For example I only need to fit a Bezier curve to $y$ between $x = \pi/6$ and $\pi/4$]

I can calculate the tangents at $P_0$ (i.e. at ${x_0,y_0}$) and $P_3$ (${x_3, y_3}$)

I am looking for a method to calculate Bezier control points $P_1$ and $P_2$ where:

  • symmetry is not a given (as was assumed in [1])
  • an approximation is adequate ([2] demonstrates that there is no exact fit)

(It isn't clear to me if the control points $P_1$ and $P_2$ must lie on the tangents; but it would be good if there is a solution where they do.)