本文主要是介绍(20200331)双线性插值法(C语言),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
参考:
【1】https://blog.csdn.net/sinat_32602421/article/details/98940243
//双线性插值
//20200331
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <math.h>double my_bilinear(double a, double b, double c, double d, double m, double n)
{double my_bi;my_bi = (1 - m)*(1 - n)*a + m*(1 - n)*b + n*(1 - m)*c + m*n*d;return my_bi;
}
int main(void){double E00=2.2l, E01=3.3l, E10=4.4l, E11=5.5l;double p=0.2l, q=0.3l;double result;printf("Input E00 E01 E10 E11:\n");//scanf("%f %f %f %f", &E00, &E01, &E10, &E11);printf("Input P and q:\n");//scanf("%f %f", &p, &q);result=my_bilinear(E00, E01, E10, E11, p, q);printf("the interpolation result is %f\n", result);system("pause");return 0;
}
这篇关于(20200331)双线性插值法(C语言)的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!