[心得] A broken heart

看板Mathematica作者 (養花種魚數月亮賞星星)時間13年前 (2011/06/28 15:08), 編輯推噓3(301)
留言4則, 4人參與, 最新討論串1/1
試試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} ] -- 養花種魚數月亮賞星星 http://chungyuandye.twbbs.org -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 118.232.166.217

06/28 15:10, , 1F
06/28 15:10, 1F

06/28 15:12, , 2F
Cool!
06/28 15:12, 2F

06/29 06:33, , 3F
!!
06/29 06:33, 3F

07/03 17:44, , 4F
讚!
07/03 17:44, 4F
文章代碼(AID): #1E2Nu52k (Mathematica)
文章代碼(AID): #1E2Nu52k (Mathematica)