Mathematica三维点插值算法(高维插值,多维插值)

pts = {{0.`, -1.`, 0.`}, {-0.2411`, -0.94`, 
   0.2412`}, {-0.3831`, -0.842`, 0.3798`}, {-0.4355`, -0.715`, 
   0.547`}, {-0.5892`, -0.5859`, 0.5564`}}
Graphics3D[{Red, PointSize[0.03], Point /@ pts, Blue, 
  Line /@ Partition[pts, 2, 1]}]

 

g[x_, y_] := 
 Evaluate[InterpolatingPolynomial[{{#[[1]], #[[2]]}, #[[3]]} & /@ 
    pts, {x, y}]]
g[x, y] // Expand
ContourPlot[g[x, y], {x, -1, 0}, {y, -1, 0}, 
 Epilog -> {Red, PointSize[0.03], Point[{#[[1]], #[[2]]}] & /@ pts}]

posted on 2012-03-22 19:23  大宝pku  阅读(3596)  评论(0编辑  收藏  举报

导航