Two Point Interpolation Equations

1. Linear Interpolation

最簡單的interpolation,也稱做 linear alpha blending,後面的式子基本上都是這個變型而來,\({\alpha}=[0,1]\)

\[x=\alpha{x_0}+\left(1-\alpha\right){x_1}\]

簡化版本,雖然不直觀,但計算上可以少一個乘法,適合程式最佳化使用

\[x=\alpha\left(x_0-x_1\right)+x_1\]

2. Cosine Interpolation

\[\alpha=0.5\left(1-cos(\pi\alpha)\right)\]

3. Smooth step Interpolation

可以用來近似cosine,比較好計算

\[\alpha={\alpha}^2(3-2\alpha)\]

Reference

  1. http://codeplea.com/simple-interpolation
  2. http://sol.gfxile.net/interpolation/

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *