I need a function that I can to evaluate it at arbitrary values of x. I want to control the shape of that function by two endpoints and two directions. A simple cubic polynomial fits that requirement, but is significantly more "rigid" than a 2D Cubic Bezier curve.
2D cubic Bezier curve is a parametric curve described by two cubic polynomials: $$x(t) = X_0*(1-t)^3 + X_1*3t(1-t)^2 + X_2*3t^2(1-t) + X_3*t^3$$ $$y(t) = Y_0*(1-t)^3 + Y_1*3t(1-t)^2 + Y_2*3t^2(1-t) + Y_3*t^3$$
If $X_0 \le X_1 \le X_2 \le X_3$ (and not $X_0 = X_1 = X_2$ or $X_1 = X_2 = X_3$) then the curve is a function $y(x)$.
However the symbolical formula for $y(x)$ is big and hard to use due to $t(x)$ being a solution to a cubic equation.
I want to find a function with simple representation such that it's graph is similar to the 2D cubic bezier graph. The function should be mainly parametrized by two endpoints ($X_0$, $Y_0$, $X_3$, $Y_3$) and two "directions" ($X_1 - X_0$, $Y_1 - Y_0$, $X_3 - X_2$, $Y_3 - Y_2$). It's OK to have some additional parameter if necessary.
Some Bezier properties that I like:
- "Monotonicity" - Does not introduce as much extra local minima as Fourier or high-order polynomial approximations
- The range of Y values between endpoints is easily bounded: $min(Y_i) \le min(y(x)) \le max(y(x)) \le max(Y_i)$
- Infinite derivatives are possible at end points
Use case: I want to use a parametrized function $f(x)$ to approximate some regions of other functions ($tanh$, $exp(x)$, $log(x)$, $max(0, exp(x))$, $1/x$, $max(0, x)$, etc) with continuous transformation between them. This is needed to represent trainable neural network activation functions.