0
我正在使用此代码来构建我在每个点的3d表面图,但我有一个问题,我需要参数化我的函数,因此t变量将从0循环到T值,但我无法弄清楚,我该如何在代表内部做到这一点?c#lambda表达式与循环
编辑的第一块更加清晰:
/*this is code for building 3d surface plot, parameter delegate is counting Z
value in each (x, y) point.
x, y are axis variables. t is constant here*/
new ILPlotCube()
{
new ILSurface((x, y) => (float) (1/(x+y+t))
}
得到的伪代码是一样的东西:
float functionValue = 0;
for (double t = 0; t < T; t + deltaT)
{
/*t is loop parameter here*/
functionValue += (float) (1/(x+y+t));
}
return functionValue;
我认为你应该去一个混淆的C#代码比赛...这是三分钟我正在阅读第一个代码块,我仍然不确定谁是谁的参数 – xanatos