数学图形之肾形
少年IPhone终于有得买了,你的肾准备好了吗?这一节给大家展示一个由数学公式生成一个肾的形状。上一节讲的是Nephroid曲线,其中提到Nephroid虽然意思是肾形的,但它不像个肾。而有种曲线名为Bean曲线,却可以看成是肾形。
The formula of the bean curve can be easily rewritten in Cartesian coordinates as
(x2 + y2)2 = x3 + y3
其极坐标方程为:
相关软件参见:数学图形可视化工具,使用自己定义语法的脚本代码生成数学图形.该软件免费开源.QQ交流群: 367752815
脚本代码:
#http://www.2dcurves.com/quartic/quarticbn.html vertices = 1000 t = from 0 to (2*PI) r = pow(sin(t), 3) + pow(cos(t), 3) x = r*sin(t) y = r*cos(t)
下一步我会将二维的Bean曲线转化成一个三维的肾形(当然你也可以认为它是豆形):
vertices = D1:64 D2:64 u = from 0 to (PI) D1 v = from (-PI/2) to (PI/2) D2 r = pow(sin(u), 3) + pow(cos(u), 3) x = r*sin(u) - 0.3 y = r*cos(u) - 0.3 a = 10 b = 2.5 x = x*a*cos(v) y = y*a*cos(v) z = b*sin(v)