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

数学图形之地形曲面

时间:2014-08-12 16:18:54      阅读:242      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   使用   os   io   数据   

      在数学表达式中,如果能写成这种形式:y = f(x, z),就可以称之为地形曲面.因为可以认为每一个平面上的位置都会对应唯一一个高度值.

      在这一节中,将展示几个地形曲面的图形.使用自己定义语法的脚本代码生成超球图形.相关软件参见:数学图形可视化工具,该软件免费开源.QQ交流群: 367752815

      这个软件的最初版本就是只针对y = f(x, z)这种方程而写的,详见:WHY数学图形显示工具.当时是输入一个数学表达式,然后再输入其数据范围来生成一个图形,如下图所示:

bubuko.com,布布扣

 

而后在这个软件的基础上,做了重构.重写了原有的数学表达式解析的算法.自己定义了一套脚本语言格式,以脚本的形式编辑数学图形.

(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)

bubuko.com,布布扣

(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

bubuko.com,布布扣

(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

bubuko.com,布布扣

(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

bubuko.com,布布扣

(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

bubuko.com,布布扣

(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

bubuko.com,布布扣

 

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

数学图形之地形曲面

标签:style   blog   http   color   使用   os   io   数据   

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

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