首页 > 代码库 > 数学图形之地形曲面
数学图形之地形曲面
在数学表达式中,如果能写成这种形式:y = f(x, z),就可以称之为地形曲面.因为可以认为每一个平面上的位置都会对应唯一一个高度值.
在这一节中,将展示几个地形曲面的图形.使用自己定义语法的脚本代码生成超球图形.相关软件参见:数学图形可视化工具,该软件免费开源.QQ交流群: 367752815
这个软件的最初版本就是只针对y = f(x, z)这种方程而写的,详见:WHY数学图形显示工具.当时是输入一个数学表达式,然后再输入其数据范围来生成一个图形,如下图所示:
而后在这个软件的基础上,做了重构.重写了原有的数学表达式解析的算法.自己定义了一套脚本语言格式,以脚本的形式编辑数学图形.
(1)
#http://www.mathcurve.com/surfaces/algebricsu/algebricsu.shtmlvertices = dimension1:101 dimension2:101x = from (-4) to (4) dimension1z = from (-4) to (4) dimension2a = (x*x + z*z)y = x*z/(a*a)y = limit(y, -5, 5)
(2)
vertices = dimension1:320 dimension2:320x = from (-4) to (4) dimension1z = from (-4) to (4) dimension2r = x^2 + z^2y = sin(x^2 + z^2*3)/(0.05 + r) + (x^2 + z^2*5)*exp(1 - r)/2u = xv = zx = x*5y = y*5z = z*5
(3)
vertices = dimension1:201 dimension2:201x = from (-20) to (20) dimension1z = from (-20) to (20) dimension2y = sin(sqrt(x*x+z*z))u = x/5v = z/5
(4)
vertices = dimension1:201 dimension2:201x = from (-8*PI) to (8*PI) dimension1z = from (-8*PI) to (8*PI) dimension2a = abs(x)b = abs(z)y = sin(a * b * 0.1)*exp((a + b)/24)u = x/5v = z/5
(5)
vertices = dimension1:201 dimension2:201x = from (-100) to (100) dimension1z = from (-100) to (100) dimension2y = sqrt(abs(x*z)) + sin(x*z*0.005)*5u = x/10v = z/10
(6)
vertices = dimension1:101 dimension2:101x = from (-100) to (100) dimension1z = from (-100) to (100) dimension2y = sqrt(abs(x*z))u = x/10v = z/10
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。