给出一段visual studio编的拉格朗日插值程序

来源:百度知道 编辑:UC知道 时间:2024/06/01 00:20:48
麻烦给出一段用 计算拉格朗日插值的公式:
要求:
1,如果输入n<6个节点,则使用其建立插值多项式;
2,如果输入n大于等于6个节点,则用相邻的6个节点做插值多项式。
只要源程序即可。完成后追加50分
需要源程序,并且给出尽可能多的注释,谢谢,我想自己弄弄懂

我这正好还留着上个学期做的数值算法的作业,就给你份吧,还动态实现了效果呢,你自己慢慢琢磨琢磨吧,应该看的懂的

#include <windows.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <iostream>

#define N 8

/* Declare Windows procedure */
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);

/* Make the class name into a global variable */
char szClassName[ ] = "WindowsApp";

int WINAPI WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nFunsterStil)

{
HWND hwnd; /* This is the handle for our window */
MSG messages; /* Here messages to the application are saved */
WNDCLASSEX wincl; /* Data structure for the windowclass */

/* The Window structure */
wincl.hInstan