Google Classroom
GeoGebraGeoGebra Classroom

貝氏曲線 (Bezier Surface)

製作重點:
  1. 先任意設定一個由空間點座標所構成的獨立 (independent) 矩陣,例如: mat = { {(0, 0, 0), (0, 1, 1), (0, 2, 0), (0, 3, 1)}, {(1, 0, 0), (1, 1, 1), (1, 2, 0), (1, 3, 1)}, {(2, 0, 0), (2, 1, 1), (2, 2, 0), (2, 3, 1)} }
  2. 計算 Bezier Surface 多項式次數: m = Dimension[mat] - 1 n = Dimension[Element[mat, 1]] - 1
  3. 計算 Bezier Surface 多項式: bx(x,y) = Sum[Sum[Sequence[Sequence[ x(Element[mat, j + 1, k + 1]) BinomialCoefficient[m, j] BinomialCoefficient[n, k] (1 - x)^(m - j) x^j (1 - y)^(n - k) y^k, k, 0, n], j, 0, m]]] 這個就是 Bezier Surface: 的 x 座標,其中 就是 mat 中的點。
  4. Bezier Surface 的 y 座標與 z 座標分別為:by(x,y), bz(x,y) 作法跟上個步驟類似。
  5. 畫出 Bezier Surface: Surface[bx(s, t), by(s, t), bz(s, t), s, 0, 1, t, 0, 1]
這個檔案內部包含了兩個主要的自製工具:
  • BezierSurface[<matrix of 3D points>] 由上面的步驟 5 產生,可用於任意的 m x n 點矩陣。
  • Net3D[<matrix fo 3D points>] 將 m x n 點矩陣相鄰的點用線段連起來(輔助用)。