数学图形(1.10) 双曲线

相关软件参见:数学图形可视化工具,使用自己定义语法的脚本代码生成数学图形.该软件免费开源.QQ交流群: 367752815

双曲线有点麻烦,因为它是两条线,而我的程序逻辑中对于渲染只是处理一条线,所以在图形中会有多余的线出现,这不太漂亮,容我以后解决.而且双曲线上的顶点容易过大,造成无效的浮点数,这也要特殊处理.

双曲线(东西开口)

vertices = 12000

t = from 0 to (2*PI)
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)

双曲线(南北开口)

vertices = 12000

t = from 0 to (2*PI)
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)

双曲线2(东西开口)

vertices = 12000
t = from (-2*PI) to (2*PI)
a = rand2(0.1, 10)
b = rand2(0.1, 10)
x = a*cosh(t)
y = b*sinh(t)
x = limit(x, -50, 50)
y = limit(y, -50, 50)

双曲线2(南北开口)

vertices = 12000

t = from (-2*PI) to (2*PI)
a = rand2(0.1, 10)
b = rand2(0.1, 10)

x = a*sinh(t)
y = b*cosh(t)

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

圆锥双曲线

vertices = 12000

t = from 0 to (2*PI)
e = rand2(1, 8)
p = rand2(0, 10)
r = e*p / (1 - e*cos(t))

x = r*sin(t)
y = r*cos(t)

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

直角双曲线

vertices = 2000

x = from -20 to 20

y = 1/x

y = limit(y, -20, 20)

 

vertices = D1:360 D2:100
u = from -10 to 10 D1
v = from -1 to 1 D2

x = u
y = v/x

y = limit(y, -100, 100)

v = v*5

双曲面(北开口)

vertices = D1:512 D2:100

u = from (-2*PI) to (2*PI) D1
v = from (0.1) to (10) D2

x = v*sinh(u)
y = cosh(u)

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

双曲面(东开口)

vertices = D1:512 D2:100

u = from (-2*PI) to (2*PI) D1
v = from (0.1) to (10) D2

x = v*cosh(u)
y = sinh(u)

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

posted on 2014-07-04 14:37  叶飞影  阅读(1973)  评论(0编辑  收藏  举报