码迷,mamicode.com
首页 > 其他好文 > 详细

数学图形之螺旋曲面

时间:2014-07-31 15:54:26      阅读:358      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   使用   os   io   2014   

这一节中将提供各种螺旋曲面的生成方法.

相关软件参见:数学图形可视化工具,使用自己定义语法的脚本代码生成数学图形.

我之前写过生成圆环的C++程序,代码发布在螺旋面(Spire)图形的生成算法

 

(1)正螺旋面

      正螺旋面就是让一条直线l的初始位置与x轴重合,然后让直线l一边绕z轴作匀速转动,一边沿z轴方向作匀速运动,则直线在这两种运动的合成下扫出的曲面就是正螺旋面。

      显然正螺旋面可以看做是由直线形成的,即它是一个直纹面。

为什么叫正,难道还有反吗?.看其公式,就是将圆向上拉了拉又多转了几圈.

vertices = D1:32 D2:360

u = from 0 to 3 D1
v = from 0 to (8*PI) D2

x = u*cos(v)
y = v*0.5
z = u*sin(v)

bubuko.com,布布扣bubuko.com,布布扣

(2)正螺旋面随机(helicoiddroit)

加上随机参数的正螺旋面,并向外拉伸了下.

vertices = D1:32 D2:360

u = from 0 to 3 D1
v = from 0 to (8*PI) D2

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

x = (b + u)*cos(v)
y = v*a
z = (b + u)*sin(v)

bubuko.com,布布扣

(3)阿基米德螺旋面

看其公式,阿基米德螺旋面就是正螺旋面变化了下高度参数

#http://202.113.29.3/nankaisource/graphics/differential%20geometry/t060307.htm
#http://www.bb.ustc.edu.cn/jpkc/xiaoji/wjf/kj/

vertices = D1:100 D2:360

u = from 0 to (2) D1
v = from 0 to (8*PI) D2

x = -u/SQRT2*cos(v)
y = u/SQRT2 + v/PI/2
z = -u/SQRT2*sin(v)

bubuko.com,布布扣

(4)sincos螺旋面

vertices = D1:720 D2:72
p = from 0 to (8*PI) D1
q = from 0 to (PI) D2

a = 5
h = rand2(0.5, 5)

x = a/2*(cos(p) + cos(q))
y = h*(p + q)/2
z = a/2*(sin(p) + sin(q))

u = p
v = q*3

bubuko.com,布布扣

(5)渐开螺旋面

#http://202.113.29.3/nankaisource/graphics/differential%20geometry/t060306.htm
#http://www.bb.ustc.edu.cn/jpkc/xiaoji/wjf/kj/

vertices = D1:100 D2:360

u = from 0 to (4*PI) D1
v = from 0 to (8*PI) D2

x = 2*[cos(u+v) + u*sin(u+v)]
y = v
z = 2*[sin(u+v) - u*cos(u+v)]

bubuko.com,布布扣

(6)双曲正弦螺旋面

vertices = D1:360 D2:72
u = from 0 to (5*PI) D1
v = from 0 to (4*PI) D2

a = 5
h = rand2(5, 20)

x = a*sh(u - v)*cos(u+v)
y = h*(u + v)
z = a*sh(u - v)*sin(u+v)

w = 50
x = limit(x, -w, w)
z = limit(z, -w, w)

bubuko.com,布布扣

(7)Developable helicoid

#http://www.mathcurve.com/surfaces/helicoiddeveloppable/helicoiddeveloppable.shtml

vertices = dimension1:1000 dimension2:72

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

a = rand2(1, 10)
b = rand2(1, 10)

x = a*(cos(u) - v*sin(u))
z = a*(sin(u) + v*cos(u))
y = b*(u + v)

bubuko.com,布布扣

(8)Helicoid_wiki

从维基上找的一种螺旋面:

#http://en.wikipedia.org/wiki/Catenoid

vertices = D1:400 D2:100

u = from (0) to (PI*16) D1
v = from (0) to (4) D2

t = rand2(-PI, PI)
s = sin(t)
c = cos(t)

x = c*sinh(v)*sin(u) + s*cosh(v)*cos(u)
z = u*c + v*s
y = -c*sinh(v)*cos(u) + s*cosh(v)*sin(u)

bubuko.com,布布扣

(9)helicoidcercle

#http://www.mathcurve.com/surfaces/helicoidcercle/helicoidcercle.shtml

vertices = D1:72 D2:1200

u = from 0 to (PI) D1
v = from 0 to (36*PI) D2

a = 1
h = 1/(2*PI)

x = a*cos(u)*cos(v)
z = a*cos(u)*sin(v)
y = b*sin(u) + h*v

bubuko.com,布布扣

 

再回到第一个脚本,正螺旋面中它的生成方式是:

"然后让直线l一边绕z轴作匀速转动,一边沿z轴方向作匀速运动"

如果用一条曲线一边绕z轴作匀速转动,一边沿z轴方向作匀速运动,那会生成何种曲面呢?

这样的话,每一种曲线都可以生成一种螺旋面.

这里再提供两个例子:

 (10)幂螺旋面

vertices = D1:32 D2:360

u = from 0 to 2 D1
v = from 0 to (8*PI) D2

a = rand2(-2, 2)
w = pow(u, a)

x = u*cos(v)
y = v*0.5 + w
z = u*sin(v)

bubuko.com,布布扣

(11)指螺旋面

vertices = D1:32 D2:360

u = from 0 to 2 D1
v = from 0 to (8*PI) D2

a = rand2(0, 2)
w = pow(a, u)

x = u*cos(v)
y = v*0.5 + w
z = u*sin(v)

bubuko.com,布布扣

 

数学图形之螺旋曲面,布布扣,bubuko.com

数学图形之螺旋曲面

标签:style   blog   http   color   使用   os   io   2014   

原文地址:http://www.cnblogs.com/WhyEngine/p/3880551.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!