What are the various ways to construct a smooth (or at least continuously differentiable) curve that passes through two arbitrary points, given the slope of the curve at the two points?
For the sake of simplicity, let's start with this scenario:
Find a function f(x) defined on the interval [0,a] that passes horizontally through the origin [f(0) = f'(0) = 0] and passes through point (a,b) with slope m. You may assume that:
- a > 0
- b > 0
- m > (a/b) [and therefore m > 0]
- f(x) >= 0
- f'(x) >= 0
In other words, you're looking for a spline curve that tangentially intersects the lines "y=0" and "y=mx+(b–ma)" at (0,0) and (a,b), respectively. (Note that the x-intercept of the latter line is at x>0.)
I've been trying to come up with solutions based on functions that satisfy f(0)=f'(0)=0 and which curve upward as x increases, scaled to fit into the box defined by (0,0) and (a,b) with the proper slope at (a,b), but I'm having trouble.
One thing I tried was scaling an arc of a circle. But I soon realized that there is only one possible circle whose center lies on the y axis and which passes through both (0,0) and (a,b), meaning an arbitrary slope value at (a,b) cannot be accommodated. (However, if the circle center is allowed to be to the right of the y axis, in some cases a circle arc could be found that tangentially intersects the x axis at x>0, with the function defined as y=0 between there and the origin.)
Next I tried a parabolic (2nd-order polynomial) function. But I couldn't figure out how to scale it in such a way that an arbitrary slope at (a,b) was possible.
A hyperbolic function might be workable, but I haven't tried it.
The trig-derived function y=tan2x seems promising, but again, I couldn't figure out the scaling.
I know a Bézier curve could be used, but I'm looking for a solution that can be expressed as a non-parametric equation.
I think a power function based around some version of y=xc — with c properly calculated from a, b, and m — could also be a solution.
Perhaps even an exponential function based around y=ex could be made to work.
What suggestions do you have? Please explain your solutions!