> 其他 >
求双线性插值法的C语言程序!
人气:147 ℃ 时间:2020-06-11 07:22:20
解答
a   b
  t
c   d
就是两次线性插值,先在x方向插出t上下方的_t1、_t2,然后再用它们插出t来
float test(float x,float y)
{
float _t1,_t2,t;
_t1 = a+(b-a)*(x-ax)/(bx-ax);
_t2 = c+(d-c)*(x-cx)/(dx-cx);
t = _t1 +(_t2-_t1)*(y - ay);
return t;
}
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版