Stats

Popular Posts

Followers

Mathematica 教學 由已繪製好的3D圖取出2D視圖

戴忠淵 於 2012年8月6日星期一 下午5:24 發表




(*假設f[x_,y_]:=Sin[x+y],原圖*)

f[x_,y_]:=Sin[x+y];
p1=Plot3D[Sin[x+y],{x,0,Pi},{y,0,Pi}]

(*取出原圖的所有樣本點,利用插值還原*)

p2=Cases[p1,GraphicsComplex[pts__]:>pts,Infinity][[1]];

(*x=Pi/2的y-z2D圖*)

ListPlot3D[p2,RegionFunction->Function[{x,y,z},x==Pi/2],
Filling->Bottom]

p3=ListPlot3D[p2,RegionFunction->Function[{x,y,z},x==Pi/2]];

ListLinePlot@SortBy[Cases[p3,GraphicsComplex[pts__]:>pts,
Infinity][[1]][[All,{2,3}]],First]

Tags: , ,

讀者回應 ( 0 意見 )

發佈留言

Please leave your name and tell me what you thought about this site. Comments, suggestions and views are welcomed.

如果這篇文章對你有幫助,那請留個訊息給我~