怎么拟合一条曲线
1、把三角形离散化,得到三角形边界上的若干点:pts = 掂迎豢畦Flatten[{{{{0, 0}}}, Table[{{0, n/m}, {n/m, 烫喇霰嘴(m - n)/m}, {(m - n)/m, 0}}, {n, 1, m, 1}] // Transpose}, 2]当m=6的时候,相当于把每条边分割为6段。

3、对诸点的坐标进行Fourier变换:f = Chop[Fourier[pts]]

5、对数据f进行如下处理:g=(2 Abs[f] Sin[π/2 - Arg[f] + 2. Pi Range[0, Length[f] - 1] t])/Sqrt[n]

7、求和,可以得到参数方程:fc = h // Total

9、把fc的图像绕原点旋转45°:fc=RotationTransform[45°][fc];Graphics[{ParametricPlot[fc, {t, 0, 1}][[1, 1, 3, 1, 2]], Line[pts]}]

11、如果m等于2,那么,图像是:
