博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
数学图形之锥体
阅读量:6612 次
发布时间:2019-06-24

本文共 2775 字,大约阅读时间需要 9 分钟。

这一节将为你展示如何生成锥体面,以及各种与锥体相关的图形,有金字塔,五角星,圆锥,冰淇淋, 正劈锥体等.

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

我之前写过生成圆锥的C++程序,代码发布在.

(1)圆锥面

vertices = dimension1:72 dimension2:72u = from 0 to (2*PI) dimension1v = from (-5) to (5) dimension2x = v*cos(u)y = vz = v*sin(u)

(2)椭圆锥面

#http://www.mathcurve.com/surfaces/coneelliptique/coneelliptique.shtmlvertices = D1:100 D2:100v = from 0 to (2*PI) D1u = from (-1) to (1) D2a = rand2(1, 10)b = rand2(1, 10)h = rand2(0.5, 10)x = a*u*cos(v)z = b*u*sin(v)y = h*u

(3)二维直线绕X轴旋转生成圆锥面

vertices = D1:360 D2:100u = from -10 to 10 D1v = from 0 to (2*PI) D2a = rand2(-5, 5)b = rand2(-5, 5)c = rand2(-2, 2)x = un = c*(x + a) + by = n*cos(v)z = n*sin(v)

(4)二维直线绕Y轴旋转生成圆锥面

vertices = D1:360 D2:100u = from -10 to 10 D1v = from 0 to (2*PI) D2a = rand2(-5, 5)b = rand2(-5, 5)c = rand2(-2, 2)y = c*(u + a) + bx = u*cos(v)z = u*sin(v)

(5)金字塔

vertices = dimension1:5 dimension2:20u = from 0 to (2*PI) dimension1v = from 0 to (1) dimension2r = if (v<0.99, 10, 0)x = r*v*cos(u)z = r*v*sin(u)y = 8*(1-v)

(6)五星

vertices = dimension1:11 dimension2:4u = from 0 to (2*PI) dimension1v = from 0 to (1) dimension2k = from 0 to 10 D1m = mod(k, 2)t = 10.0 - m*GOLD*10r = if(v < 0.99, t, 0)x = r*v*cos(u)z = r*v*sin(u)y = 2*(1-v)

(7)N角星

vertices = dimension1:360 dimension2:4u = from 0 to (2*PI) dimension1v = from 0 to (1) dimension2n = rand_int2(4, 32)*2k = from 0 to (n) D1m = abs(mod(k, 2) - 1)t = 10.0 - m*GOLD*10r = if(v < 0.99, t, 0)x = r*v*cos(u)z = r*v*sin(u)y = 2*(1-v)

(8)风车

vertices = dimension1:72 dimension2:4u = from 0 to (2*PI) dimension1v = from 0 to (1) dimension2k = from 0 to 8 D1m = mod(k, 2)t = 10.0 - m*GOLD*10r = if(v < 0.99, t, 0)x = r*v*cos(u)z = r*v*sin(u)y = 2*(1-v)

(9)冰淇淋

vertices = dimension1:72 dimension2:72u = from 0 to (2*PI) dimension1v = from 0 to (PI) dimension2r = 10.0x = r*sin(v)*sin(u)y = r*cos(v)z = r*sin(v)*cos(u)a = rand2(PI/2, PI*0.8)d = -r*4t = r*cos(a)e = (v - a)/(PI - a)w = r*sin(a)*(1 - e)h = t + e*(d - t)i = w*sin(u)j = w*cos(u)x = if(e < 0.0, x, i)y = if(e < 0.0, y, h)z = if(e < 0.0, z, j)

 

(10)曲线绕Y轴旋转生成圆锥面

#http://www.mathcurve.com/surfaces/conederevolution/conederevolution.shtmlvertices = D1:100 D2:100v = from (-PI) to (PI) D1u = from (-PI) to (PI) D2a = rand2(0, PI*0.45)x = a*(cos(v) + cos(u))z = a*(sin(u) + sin(v))y = 2*a*cot(a)*cos((u-v)/2)

 

(11)任意朝向的圆锥

vertices = D1:72 D2:72u = from 0 to (2) D2v = from 0 to (2*PI) D1a = rand2(0, 2*PI)b = rand2(0, 2*PI)c = sin(v)d = cos(v)e = sin(b)f = cos(b)g = sin(a)h = cos(a)x = f*h*d - f*g*3 + e*cy = g*d + h*3z = -e*h*d + e*g*3 + f*cx = x*uy = y*uz = z*ux = x*5y = y*5z = z*5

 

(12)正劈锥体

#http://www.mathcurve.com/surfaces/coinconic/coinconic.shtmlvertices = D1:100 D2:100v = from 0 to (2*PI) D1u = from -10 to 10 D2a = rand2(1, 10)b = rand2(1, 10)k = b/ax = uz = k*u*cos(v)y = k*a*sin(v)

 

转载地址:http://trxso.baihongyu.com/

你可能感兴趣的文章
HDUPhysical Examination(贪心)
查看>>
苹果公司的产品已用完后门与微软垄断,要检查起来,打架!
查看>>
Android官方架构组件LiveData: 观察者模式领域二三事
查看>>
你必须知道的HTTP基本概念
查看>>
Android ContentProvider调用报错"Bad call:..."及相关Binder权限问题分析
查看>>
基本shell脚本的编辑及变量
查看>>
加密和解密 tar
查看>>
将datatable 保存为 Excel文件(高效率版本)
查看>>
C/C++五大内存分区(转)
查看>>
CentOS 6.5下PXE+Kickstart无人值守安装操作系统
查看>>
xtrapivotcontrol 控件用法及相关属性
查看>>
Shell脚本 常用命令总结 二
查看>>
JS模拟select下拉菜单
查看>>
vmware workstation14永久激活密钥分享
查看>>
iOS 多线程 之 GCD(大中枢派发)(一)
查看>>
Myeclipse中打开接口实现类的快捷键
查看>>
删除sql dump中的AUTO_INCREMENT
查看>>
使用JdbcTemplate和JdbcDaoSupport
查看>>
C博客作业--指针
查看>>
版本12.2.0.1.0数据库,复制种子数据库快速创建租户数据库PDB
查看>>