Hello,
I am trying to bi-interpolate a 10x10 elements using maps definition, i need to compute the interpolation reslts very very fast.
using the map i can only do a linear interpolation, but the problem is that i have to interpolate on the whole area
my interpolation function is :
std::pair<double, double> interpolate(const std::map<double,double> &data,
double x, double y)
{
typedef std::map< double, double>::const_iterator i_t, i_t2;
}
i_t l=i; --l;
i_t lc=c; --lc;
const double deltai=(x- l->first)/(i->first - l->first);
const double deltac=(y- lc->first)/(c->first - lc->first);
return std::make_pair(deltai*i->second +(1-deltai)*l->second , deltac*c->second +(1-deltac)*lc->second);
}
it works exactly as it is linear interpolation and i dont know how to solve it, i really need an urgent help, please!