直接來看個最簡單的例子,直接到 Google 的首頁打上
sin(x)
就像這樣:
按下搜尋之後,Google 就會自動幫你畫出 sin(x) 的圖形(連結):
若是要同時畫出多個方程式,則用逗點分開:
x/2, (x/2)^2, ln(x), cos(pi*x/5)
畫出來的圖形就像這樣(連結):
這些畫出來的圖形可以使用滑鼠放大、縮小或平移,使用上很方便,另外除了二維的圖形之外,他也支援 3D 的繪圖,其所利用的技術是最新的 WebGL 技術(所以您的瀏覽器要夠新,否則就沒辦法使用這個功能),可以及時劃出會動的 3D 圖形,接著看一個最簡單的例子:
sin(x) + cos(y)
這樣就可以畫出 3D 的圖形了(連結):
另外看一個比較複雜的範例:
sqrt(x*x+y*y)+3*cos(sqrt(x*x+y*y))+5 from -20 to 20
畫出的圖形為(連結):
這個圖形可以使用滑鼠來轉動,所以可以很方便的看到 3D 圖的每個方向,有了這麼方便的工具,就不用開 Matlab 了。
另外附上一些有趣範例,大家可以玩玩看:
- sqrt(x*x+y*y)+3*cos(sqrt(x*x+y*y))+5 [連結]
- 1/(sin(abs(x)+x)-cos(abs(y)+y)) [連結]
- sin(5.5x)*cos(5*y)+x*x+1 [連結]
- 5000-140*(x*x+y*y)+(x*x+y*y)^2 [連結]
- sin(x^2+y^2)/(abs(x*y)+1) from -2.5 to 2.5 [連結]
- tanh(y(y^4+5x^4-10(x^2)(y^2))/(x^2+y^2)^4) [連結]
- (x^2+((3 y)/2-(x^2+abs(x)-6)/(x^2+abs(x)+2))^2)-36 [連結]
- sin(5.5x)*cos(5*y)+x*x+1 x is from -1 to 1, y is from -1 to 1, z is from 0.1 to 2.8 [連結]
- 100-3/(sqrt(x^2+y^2))+sin(sqrt(x^2+y^2)), x is from -10 to 10, y is from -10 to 10, z is from 85 to 101 [連結]
- 5 + (-sqrt(1-x^2-(y-abs(x))^2))*cos(30*((1-x^2-(y-abs(x))^2))), x is from -1 to 1, y is from -1 to 1.5, z is from 1 to 6 [連結]
- 100-3/(sqrt(x^2+y^2))+sin(sqrt(x^2+y^2))+sqrt(200-(x^2+y^2)+10*sin(x)+10sin(y))/1000, x is from -15 to 15, y is from -15 to 15, z is from 90 to 101 [連結]
- sqrt(x*x+y*y)+50*tan(sqrt(x*x+y*y)) [連結]
- exp(-((x-4)^2+(y-4)^2)^2/1000) + exp(-((x+4)^2+(y+4)^2)^2/1000) + 0.1exp(-((x+4)^2+(y+4)^2)^2)+0.1exp(-((x-4)^2+(y-4)^2)^2) [連結]
- sqrt(cos(3*x))*cos(100*y)+1.5*sqrt(abs(x)) + 0.8 x is from -1 to 1, y is from -1 to 1, z is from 0.01 to 2.5 [連結]
- sqrt(x*y+y*y)+3*sin(sqrt(x*x+y*y))+5 from -20 to 20 [連結]
- sqrt(x*x+y*y)+3*tan(sqrt(x*x+y*y))+10 [連結]
- x^2+y^2+x*y*sin(x+y) from -20 to 20 [連結]
參考資料:
http://www.webgl.com/2012/03/webgl-demo-google-search-3d-graph/
沒有留言:
張貼留言