在数学表达式中,如果能写成这种形式:y = f(x, z),就可以称之为地形曲面.因为可以认为每一个平面上的位置都会对应唯一一个高度值.
在这一节中,将展示几个地形曲面的图形.使用自己定义语法的脚本代码生成超球图形.相关软件参见:数学图形可视化工具,该软件免费开源.QQ交流群: 367752815
这个软件的最初版本就是只针对y = f(x, z)这种方程而写的,详见:WHY数学图形显示工具.当时是输入一个数学表达式,然后再输入其数据范围来生成一个图形,如下图所示:
而后在这个软件的基础上,做了重构.重写了原有的数学表达式解析的算法.自己定义了一套脚本语言格式,以脚本的形式编辑数学图形.
(1)
#http://www.mathcurve.com/surfaces/algebricsu/algebricsu.shtml vertices = dimension1:101 dimension2:101 x = from (-4) to (4) dimension1 z = from (-4) to (4) dimension2 a = (x*x + z*z) y = x*z/(a*a) y = limit(y, -5, 5)
(2)
vertices = dimension1:320 dimension2:320 x = from (-4) to (4) dimension1 z = from (-4) to (4) dimension2 r = x^2 + z^2 y = sin(x^2 + z^2*3)/(0.05 + r) + (x^2 + z^2*5)*exp(1 - r)/2 u = x v = z x = x*5 y = y*5 z = z*5
(3)
vertices = dimension1:201 dimension2:201 x = from (-20) to (20) dimension1 z = from (-20) to (20) dimension2 y = sin(sqrt(x*x+z*z)) u = x/5 v = z/5
(4)
vertices = dimension1:201 dimension2:201 x = from (-8*PI) to (8*PI) dimension1 z = from (-8*PI) to (8*PI) dimension2 a = abs(x) b = abs(z) y = sin(a * b * 0.1)*exp((a + b)/24) u = x/5 v = z/5
(5)
vertices = dimension1:201 dimension2:201 x = from (-100) to (100) dimension1 z = from (-100) to (100) dimension2 y = sqrt(abs(x*z)) + sin(x*z*0.005)*5 u = x/10 v = z/10
(6)
vertices = dimension1:101 dimension2:101 x = from (-100) to (100) dimension1 z = from (-100) to (100) dimension2 y = sqrt(abs(x*z)) u = x/10 v = z/10
数学图形之地形曲面
时间: 2024-10-08 23:58:41