md_files/科研/草稿.md

42 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# B样条拟合示例用正弦函数采样作为系数
我选择的系数是通过在四个节点处对函数 $f(t) = \sin\left(\dfrac{\pi t}{4}\right)$ 进行采样得到的,对应的是四个基函数 $B_0(t), B_1(t), B_2(t), B_3(t)$,其"峰值"分别位于:
- $B_0(t)$:在 $t = 0$ 处取值 1
- $B_1(t)$:在 $t = 1$ 处取值 1
- $B_2(t)$:在 $t = 2$ 处取值 1
- $B_3(t)$:在 $t = 3$ 处取值 1
## 系数计算过程
用来拟合的四个系数是函数在基函数峰值位置的采样值:
$$
\begin{align*}
c_0 &= f(0) = \sin(0) = 0 \\
c_1 &= f(1) = \sin\left(\frac{\pi}{4}\right) \approx 0.7071 \\
c_2 &= f(2) = \sin\left(\frac{\pi}{2}\right) = 1 \\
c_3 &= f(3) = \sin\left(\frac{3\pi}{4}\right) \approx 0.7071 \\
\end{align*}
$$
## 拟合曲线构造
最终的B样条拟合曲线是基函数的线性组合
$$
S(t) = 0 \cdot B_0(t) + 0.7071 \cdot B_1(t) + 1 \cdot B_2(t) + 0.7071 \cdot B_3(t)
$$
## 可视化建议
需要展示以下内容吗?
1. 原始函数 $f(t) = \sin(\pi t/4)$ 的曲线
2. 四个采样点 $(0,0)$, $(1,0.7071)$, $(2,1)$, $(3,0.7071)$
3. 每个基函数 $B_i(t)$ 及其对应的系数 $c_i$
4. 最终合成的紫色B样条曲线 $S(t)$
---
这种构造方式展示了B样条的一个重要特性**系数直接对应曲线在基函数峰值位置的值**(当基函数是标准归一化时)。