|||
所谓“Batman Equation(蝙蝠侠方程)”——不是真的!
文|麦地
传说中的“蝙蝠侠方程”[1]
为了证实此方程是否存在,用matlab软件对其画图:
(1)代码中使用整体方程得如下图一
由图可见并没有完整的“蝙蝠侠”标志出现,而是出现了线条的重叠,显然“batman equation”作为一个方程是不能得到蝙蝠侠图案的,也就证明了此方程是不存在的。
(2)蝙蝠侠图案是如何得到呢?我们再次看所谓的“batman equation”,它是由六个括号相乘得到的,不妨我们猜测原作者是分段画出来的。由此写出第二组代码,其中使用分段函数。啊哈!我们得到了蝙蝠侠图标,如下图:
从上面看,所谓的“batman equation”的原作者,误以为分段函数乘积是一个函数。之所以如此是因为没有考虑到函数的值域与定义域。引以为鉴吧
代码一[2]
batman = '((x/7)^2 * sqrt(abs(abs(x)-3)/(abs(x)-3)) + (y/3)^2 * sqrt(abs(y+ 3*sqrt(33)/7)/(y+3*sqrt(33)/7))-1) * (abs(x/2)-(3*sqrt(33)-7)/112*x^2-3+sqrt(1-(abs(abs(x)-2)-1)^2)-y) * (9*sqrt(abs((abs(x)-1)*(abs(x)-0.75))/((1-abs(x))*(abs(x)-0.75)))-8*abs(x)-y) * (3*abs(x)+0.75*sqrt(abs((abs(x)-0.75)*(abs(x)-0.5))/((0.75-abs(x))*(abs(x)-0.5)))-y) * (2.25*sqrt(abs((x-0.5)*(x+0.5))/((0.5-x)*(0.5+x)))-y) * (6*sqrt(10)/7+(1.5-0.5*abs(x))*sqrt(abs(abs(x)-1)/(abs(x)-1))-6*sqrt(10)/14*sqrt(4-(abs(x)-1)^2)-y)';
figure(1);
ezplot(batman, [-7.2 7.2 -3.5 3.5])
title('Batman£¨1£©')
xlabel(' ')
ylabel(' ')
代码二[3]
% Grey axe
figure(2);
axes('Xlim' ,[-7 7] , 'Xtick' ,-7:7,...
'Ylim' ,[-5 5] , 'Ytick' ,-5:5,...
'YtickL','' , 'XtickL','' ,...
'Ygrid' ,'on' , 'Xgrid' ,'on',...
'Xcolor',[.8 .8 .8], 'Ycolor',[.8 .8 .8]);
hold on
% Outer wings
f1 = '(x/7)^2 * sqrt(abs(abs(x)-3)/(abs(x)-3)) + (y/3)^2 * sqrt(abs(y + 3/7*sqrt(33))/(y + 3/7*sqrt(33))) - 1';
ezplot(f1,[-8 8 -3*sqrt(33)/7 6-4*sqrt(33)/7]);
% Bottom
f2 = 'abs(x/2)-(3*sqrt(33)-7) * x^2/112 - 3 + sqrt(1-(abs(abs(x)-2)-1)^2) - y';
ezplot(f2,[-4 4]);
% Outer ears
f3 = '9 * sqrt(abs((1-abs(x))*(abs(x)-0.75)) / ((1-abs(x))*(abs(x)-0.75))) - 8*abs(x) - y';
ezplot(f3,[-1 -0.75 -5 5]);
ezplot(f3,[ 0.75 1 -5 5]);
% Inner ears
f4 = '3*abs(x) + 0.75*sqrt(abs((0.75-abs(x))*(abs(x)-.5)) / ((.75-abs(x))*(abs(x)-.5))) - y';
ezplot(f4,[-0.75 0.75 2.25 5]);
% Connect inner ears (flat line)
f5 = '2.25*sqrt(abs(((0.5-x)*(0.5+x))/((0.5-x)*(0.5+x)))) - y';
ezplot(f5,[-0.5 0.5 -5 5]);
% Inner wings
f6 = '6*sqrt(10)/7 + (1.5-0.5*abs(x)) * sqrt(abs(abs(x)-1) / (abs(x)-1)) - 6*sqrt(10)/14 * sqrt(4-(abs(x)-1)^2) - y';
ezplot(f6,[-3 -1 -5 5]);
ezplot(f6,[ 1 3 -5 5]);
% Change line color and width
set(get(gca,'children'),'Color','b','Linew',2)
% Title and labels
title('Batman'); xlabel(''); ylabel('')
% Superimpose black axes with xy-ticklabels
xlbl(1:15,1:2) = ' '; xlbl([1,8,15],:) = ['-7';' 0';' 7'];
ylbl(1:11,1:2) = ' '; ylbl([1,6,11],:) = ['-5';' 0';' 5'];
axes('Xlim' ,[-7 7], 'Xtick' ,-7:7,...
'Ylim' ,[-5 5], 'Ytick' ,-5:5,...
'YtickL',ylbl , 'XtickL',xlbl,...
'Box' ,'on' , 'Color' ,'none');
参考:
[1] http://math.stackexchange.com/questions/54506/is-this-batman-equation-for-real
[2] (第一次找到,忘记保存,然后怎么也找不到了,那位大神帮忙找到后,补上,谢谢)
[3] http://www.mathworks.com/matlabcentral/answers/13131
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-5-7 08:51
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社