⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 legendre.h

📁 Legendre正交多项式拟合,可对任意曲线进行拟合
💻 H
字号:
/** \file Legendre.h
  * \brief Legendre多项式逼近
  */

#include <vector>

/** \brief 计算n次Legendre多项式在x点的值
  *
  * \param x 要获取其值的点
  * \param n Legendre多项式的阶数
  * \attention
  *(1)-1 <= x <= 1;
  *(2)为了使Legendre(x,n)*Legendre(x,n)=1,作了归一化处理
  */
float Legendre(float x, int n);

/** \brief 对(x, y)作Legendre多项式拟合,最高阶次为n
  *
  * \param x 所要逼近的函数的横坐标点集合
  * \param y 所要逼近的函数的纵坐标点集合
  * \param size (x,y)点的个数
  * \param n 所使用的Legendre多项式的最高阶数
  * \attention
  *(1)返回值是一个大小为n+1的向量组(包括零阶多项式系数)
  */
std::vector<float> BestLegendre(float* x, float* y, int size, int n);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -