如题所述
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;
}追问
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;
}追问
这位朋友,我想想还是没做出来,可以帮我再具体点吗?十分感谢!
温馨提示:答案为网友推荐,仅供参考