標題: [心得] A broken heart
時間: Tue Jun 28 15:08:31 2011
試試8.0 2D-3D 繪圖 Texture 的功能
tt=Import["http://tinyurl.com/3m4awrv"];
ff[xx_]:=Cases[y/.NSolve[(y^2+xx^2-1)^3-y^2*xx^3==0,y],_Real][[-1]];
data={#,RandomReal[{-0.15,0.25}]}&/@Range[-0.9,0.9,0.05];
m[de_]:={{Cos[de],-Sin[de]},{Sin[de],Cos[de]}};
slope[pt_List]:=(pt[[2,2]]-pt[[1,2]])/(pt[[2,1]]-pt[[1,1]]);
pt=Partition[Flatten[{{#[[1]],Min[Max[#[[2]],-ff[#[[1]]]]*0.75,
ff[#[[1]]]]*0.75}&/@data,{{1,0}}},1],2,1];
eq=Piecewise[{slope[#]*(x-#[[1,1]])+#[[1,2]],#[[1,1]]<=x<#[[2,1]]}&/@pt];
bh1=RegionPlot[(y^2+x^2-1)^3-y^2x^3<0&&y<eq,
{y,-1.5,1.5},{x,-1.5,1.5},PlotStyle->Texture[tt]];
bh2=RegionPlot[(y^2+x^2-1)^3-y^2x^3<0&&y>eq,
{y,-1.5,1.5},{x,-1.5,1.5},PlotStyle->Texture[tt]];
Manipulate[Show[
bh1/.GraphicsComplex[a__,b__]:>GraphicsComplex[{-l,0}
+(#+{0,1}).m[-z*Pi/10]&/@a,b],
bh2/.GraphicsComplex[a__,b__]:>GraphicsComplex[{l,0}
+(#+{0,1}).m[z*Pi/10]&/@a,b],
PlotRange->{{-1.5,1.5},{-0.5,2.5}},Frame->False],
{z,0,1,0.1},{l,0,0.3,0.1}
]
--
養花種魚數月亮賞星星
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 118.232.166.217
[1;31m→ [33mchungyuandye[m[33m:輸出 http://tinyurl.com/3wwr4uy [m 06/28 15:10
[1;37m推 [33mFrobenius[m[33m:Cool! [m 06/28 15:12
沒有留言:
張貼留言