前几天,我曾经发布过关于如何生成花形曲线的文章,参见
这一节中,会将二维的花形曲线变成三维的花形曲面,其样子会漂亮很多.
相关软件参见:数学图形可视化工具,使用自己定义语法的脚本代码生成数学图形.
(1)玫瑰线
vertices = D1:4000 D2:6 n = 8 u = from 0 to (n*PI) D1 v = from 0 to 1 D2 a = rand_int2(2, 16) r = 10*sin(a*u)*v k = u/n/2 x = r*cos(u)*cos(k) z = r*sin(u)*cos(k) y = GOLD* abs(r)*sin(k)
(2)双层玫瑰
vertices = D1:4000 D2:6 n = rand_int2(3, 16) u = from 0 to (n*PI) D1 v = from 0 to 1 D2 r = 10*(1 + 3*sin(n*u))*v k = u/n/2 x = r*cos(u)*cos(k) z = r*sin(u)*cos(k) y = GOLD* abs(r)*sin(k)
(3)超级玫瑰
#http://www.2dcurves.com/roulette/rouletters.html vertices = D1:8000 D2:6 n = 16 u = from 0 to (n*PI) D1 v = from 0 to 1 D2 a = rand_int2(1, 100) / 8 b = rand_int2(1, 100) / 8 c = rand_int2(-10, 100) / 8 d = rand_int2(1, 100) / 8 f = rand_int2(1, 100) / 8 w = pow(abs(cos(d*u)), a) + pow(abs(sin(d*u)), b) r = 10*v*sin(f*u)*pow(w, c) w = u/n/2 x = r*sin(u)*cos(w) z = r*cos(u)*cos(w) y = GOLD*abs(r)*sin(w)
(4)N叶草
#http://www.mathcurve.com/courbes2d/biquartic/biquartic.shtml vertices = D1:4000 D2:6 m = 8 u = from (-PI) to (m*PI) D1 v = from 0 to 1 D2 n = rand_int2(3, 10) p = (1 + cos(n*u) + sin(n*u)^2) * v k = u/m/2 x = p*cos(u)*cos(k) z = p*sin(u)*cos(k) y = abs(p)*sin(k)
(5)folioide
vertices = D1:6 D2:4000 m = 32 u = from (-PI/2) to (m*PI) D2 v = from 0 to 1 D1 e = rand2(0.1, 10) a = 10 / e i = rand_int2(2, 10) j = rand_int2(1, 10) n = i/j p = a*(e*cos(n*u) + sign(u)*e*sqrt(1 - pow(cos(n*u), 2)))*v w = u/m/2 x = p*cos(u)*cos(w) z = p*sin(u)*cos(w) y = GOLD * abs(p)*sin(w)
(6)botanic
#http://www.2dcurves.com/roulette/rouletteb.html vertices = D1:8000 D2:6 n = 32 u = from 0 to (n*PI) D1 v = from 0 to 1 D2 r = 10*v c = rand2(0.1, 10) d = rand2(1, 10) p = r*(1 + d*sin(c*u)) w = u/n/2 x = p*cos(u)*cos(w) z = p*sin(u)*cos(w) y = 0.6*abs(p)*sin(w)
时间: 2024-10-14 05:49:50