I would like to use a Spline-Function to describe a transformation from one range of reals to another, that is I would like to have a function which maps a value $y$ on $x$ and for simplicity let us assume that $x,y \in [0,1]$.
The idea was to define a smooth, nonlinear function which is to be within the boundary points $\{(0,0),(\alpha,\beta),(1,1)\}$ with $\alpha,\beta \in [0,1]$, also. Thus a Bezier- or BSpline-Function seemed to be appropriate.
Unfortunately I can't see how I can use the Spline-Function directly to map $y$ on $x$ (or vice versa for that). The Spline-Function will one parameter $t$ with $t \in [0,1]$ and will give all points on the curve, e.g. $spline(0) = (0,0), spline(1) = (1,1)$.
So to find say the corresponding $x$ value for $y=0.6$, I tried something like this:
f = BSplineFunction[{{0, 0}, {0.2, 0.7}, {1, 1}}];
FindInstance[Last@f[t]==0.6,t]
But what I am getting is the false answer $\{\{t\rightarrow 0.6 \}\}$. The correct answer should have been $t = 0.5$.
So far I have also tried Reduce, Solve, NSolve, FindRoot (giving a start value for t) and have of course given the domain to be Reals. But nothing works.
Is there a way to do this without having to substitute a simpler function for the Spline-Function (e.g. using Interpolation[]
)?
Interpolation[ ]
? $\endgroup$Interpolation[]
where I have gotten the best results usingInterpolationOrder->2
. But that still is not perfect and still wonder why equation solving won't work here. $\endgroup$t -> .72
sincef[.5]
givesy -> .6
in this case? $\endgroup$Last
instead ofFirst
in my post here and so you are correct. But that still does not change the principle problem with equation solving. Thanks for pointing out the error, I will edit my question. $\endgroup$