數學圖形之雙葉雙曲面


雙曲線繞其對稱軸旋轉而生成的曲面即為雙曲面,上節講了單葉雙曲面,這一節繼續講雙葉雙曲面.

雙葉雙曲面的數學公式如下:

x*x/a/a + y*y/b/b - z*z/c/c = -1

在數學里,雙曲面是一種二次曲面。采用直角坐標 (x,\ y,\ z)\,\! ,雙曲面可以用公式表達為

{x^2 \over a^2} + {y^2 \over b^2} - {z^2 \over c^2}=1\,\!  (單葉雙曲面),

 - {x^2 \over a^2} - {y^2 \over b^2} + {z^2 \over c^2}=1\,\!  (雙葉雙曲面)。

假若,a=b\,\! ,則稱為旋轉雙曲面

本文將展示幾種生成雙葉雙曲面算法和切圖.使用自己定義語法的腳本代碼生成數學圖形.相關軟件參見:數學圖形可視化工具,該軟件免費開源.QQ交流群: 367752815

(1)

#x*x/a/a + y*y/b/b - z*z/c/c = -1

vertices = dimension1:72 dimension2:72

u = from 0 to (2*PI) dimension1
v = from (-5) to (5) dimension2 

a = rand2(1, 5)
b = rand2(1, 5)
c = rand2(1, 5)

x = a*sqrt(v*v - 1)*cos(u)
z = b*sqrt(v*v - 1)*sin(u)
y = c*v

(2)

vertices = D1:100 D2:100
u = from 0 to (1*PI) D1
v = from (0) to (2*PI) D2 gap[PI*0.5, PI*1.5]
a = rand2(1, 10)
b = rand2(1, 10)
c = rand2(1, 10)
x = a*tan(v)*sin(u)
y = b*sec(v)
z = c*tan(v)*cos(u)

(3)

我之前寫過關於雙曲線的文章,數學圖形(1.10) 雙曲線

將雙曲線旋轉一周即能生成雙曲面.

vertices = 360
u = from -1 to 1 gap[0]

x = u
y = 1/x

y = limit(y, -50, 50)

surface_slices = 72
rotate = anchor[0, 0, 0], axis[1, 1, 0], angle[0, 2*PI]

(4)

雙曲面(東西開口)

vertices = 100

t = from 0 to (2*PI) gap[PI*0.5, PI, PI*1.5]
a = rand2(0.1, 10)
b = rand2(0.1, 10)

x = a*sec(t)
y = b*tan(t)

x = limit(x, -50, 50)
y = limit(y, -50, 50)

surface_slices = 72
rotate = anchor[0, 0, 0], axis[1, 0, 0], angle[0, 2*PI]

雙曲面(南北開口)

vertices = 100

t = from 0 to (2*PI) gap[PI*0.5, PI, PI*1.5]
a = rand2(0.1, 10)
b = rand2(0.1, 10)

x = a*tan(t)
y = b*sec(t)

x = limit(x, -50, 50)
y = limit(y, -50, 50)

surface_slices = 72
rotate = anchor[0, 0, 0], axis[0, 1, 0], angle[0, 2*PI]

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM