📄 d9r7.txt
字号:
import java.text.*;
public class d9r7
{
public static void main (String[] args)
{
//program d9r7
//driver for routine fleg
int nval = 5;
double x, dx = 0.2;
int i, j, npoly = 5;
double afunc[] = new double[6];
d9r7F g = new d9r7F();
DecimalFormat form = new DecimalFormat("0.0000");
System.out.println("Legendre polynomials");
System.out.println(" n = 1 n = 2 n = 3 n = 4 n = 5");
for (i = 1; i <= nval; i++)
{
x = i * dx;
g.fleg(x, afunc, npoly);
System.out.print(" x = " + " ");
System.out.println(x);
for (j = 1; j <= npoly; j++)
{
System.out.print(form.format(afunc[j]) + " ");
}
System.out.println(" routine fleg");
for (j = 1; j <= npoly; j++)
{
System.out.print(form.format(g.plgndr(j - 1, 0, x)) + " ");
}
System.out.println(" routine plgndr");
System.out.println();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -