首页 > 代码库 > 数学图形之螺旋管
数学图形之螺旋管
上一节讲的是螺旋曲面,这一节中将曲面绕个圈,生成螺旋管.提供了若干种生成螺旋管的脚本代码,最后还生成麻花的图形.
相关软件参见:数学图形可视化工具,使用自己定义语法的脚本代码生成数学图形.
(1)螺旋管
vertices = D1:720 D2:72u = from 0 to (10*PI) D1v = from 0 to (2*PI) D2a = 3x = (a + cos(v)) * cos(u)z = (a + cos(v)) * sin(u)y = sin(v) + u
(2)螺旋管随机
vertices = D1:720 D2:72u = from 0 to (6*PI) D1v = from 0 to (2*PI) D2a = rand2(2, 5)b = rand2(0.5, 1)c = rand2(0.5, 2)x = c * (a + b * cos(v)) * cos(u)y = c * (a + b * cos(v)) * sin(u)z = c * b * sin(v) + u * 2/PI - 6
(3)螺旋管(逐渐变细)
可以将螺旋管想象成一个圆圈曲线绕一轴旋转+平移
vertices = D1:720 D2:72u = from 0 to 1 D1v = from 0 to (2*PI) D2a = 3b = 5x = (1 - u)*(a + cos(v)) * cos(b*PI*u)z = (1 - u)*(a + cos(v)) * sin(b*PI*u)y = (1 - u)*sin(v) + a*u + PIu = u*10
(4)Circle 旋转管
vertices = D1:100 D2:600u = from (0) to (2*PI) D1v = from 0 to (12*PI) D2r = 2m = rand2(r, r*10)n = r*cos(u) + my = r*sin(u) + vx = n*cos(v)z = n*sin(v)
(5)麻花曲面
vertices = D1:3600 D2:100u = from 0 to (PI*10) D1v = from 0 to (PI*2) D2a = 10b = rand2(5, 10)x = a*cos(u)*cos(v)z = a*sin(u)*cos(v)y = a*sin(v) + b*u
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。