HardOCP has an image with an equation which apparently draws the Batman logo. Is this for real?

Batman logo

link|improve this question
33  
Why don't you just try it? – Jonas Teuwen Jul 29 '11 at 21:19
8  
Yes, use WolframAlpha and post the link :) – P23 Jul 29 '11 at 21:24
39  
@Jim: If you mouse over the downvote button, you see: "This question does not show any research effort; it is unclear or not useful." I downvoted because the OP was too lazy to type in the equation himself to any plotting program or calculator, which would have immediately shown that the equation is "for real". If the OP were asking for an explanation of how such an equation might be derived, as ShreevatsaR has done, that would be an appropriate question. – Zev Chonoles Jul 30 '11 at 17:08
47  
I don't understand why this question has so many upvotes. – Jonas Teuwen Aug 3 '11 at 18:36
20  
@Jacob wolframalpha.com/input/?i=batman+equation – splattne Aug 31 '11 at 14:40
show 9 more comments
feedback

8 Answers

up vote 377 down vote accepted

As Willie Wong observed, including an expression of the form $\displaystyle \frac{|\alpha|}{\alpha}$ is a way of ensuring that $\alpha > 0$. (As $\sqrt{|\alpha|/\alpha}$ is $1$ if $\alpha > 0$ and non-real if $\alpha < 0$.)


The ellipse $\displaystyle \left( \frac{x}{7} \right)^{2} + \left( \frac{y}{3} \right)^{2} - 1 = 0$ looks like this:

ellipse

So the curve $\left( \frac{x}{7} \right)^{2}\sqrt{\frac{\left| \left| x \right|-3 \right|}{\left| x \right|-3}} + \left( \frac{y}{3} \right)^{2}\sqrt{\frac{\left| y+3\frac{\sqrt{33}}{7} \right|}{y+3\frac{\sqrt{33}}{7}}} - 1 = 0$ is the above ellipse, in the region where $|x|>3$ and $y > -3\sqrt{33}/7$:

ellipse cut

That's the first factor.


The second factor is quite ingeniously done. The curve $\left| \frac{x}{2} \right|\; -\; \frac{\left( 3\sqrt{33}-7 \right)}{112}x^{2}\; -\; 3\; +\; \sqrt{1-\left( \left| \left| x \right|-2 \right|-1 \right)^{2}}-y=0$ looks like:

second factor

This is got by adding $y = \left| \frac{x}{2} \right| - \frac{\left( 3\sqrt{33}-7 \right)}{112}x^{2} - 3$, a parabola on the positive-x side, reflected:

second factor first term

and $y = \sqrt{1-\left( \left| \left| x \right|-2 \right|-1 \right)^{2}}$, the upper halves of the four circles $\left( \left| \left| x \right|-2 \right|-1 \right)^2 + y^2 = 1$:

second factor second term


The third factor $9\sqrt{\frac{\left( \left| \left( 1-\left| x \right| \right)\left( \left| x \right|-.75 \right) \right| \right)}{\left( 1-\left| x \right| \right)\left( \left| x \right|-.75 \right)}}\; -\; 8\left| x \right|\; -\; y\; =\; 0$ is just the pair of lines y = 9 - 8|x|:

Third factor without cut

truncated to the region $0.75 < |x| < 1$.


Similarly, the fourth factor $3\left| x \right|\; +\; .75\sqrt{\left( \frac{\left| \left( .75-\left| x \right| \right)\left( \left| x \right|-.5 \right) \right|}{\left( .75-\left| x \right| \right)\left( \left| x \right|-.5 \right)} \right)}\; -\; y\; =\; 0$ is the pair of lines $y = 3|x| + 0.75$:

fourth factor without cut

truncated to the region $0.5 < |x| < 0.75$.


The fifth factor $2.25\sqrt{\frac{\left| \left( .5-x \right)\left( x+.5 \right) \right|}{\left( .5-x \right)\left( x+.5 \right)}}\; -\; y\; =\; 0$ is the line $y = 2.25$ truncated to $-0.5 < x < 0.5$.


Finally, $\frac{6\sqrt{10}}{7}\; +\; \left( 1.5\; -\; .5\left| x \right| \right)\; -\; \frac{\left( 6\sqrt{10} \right)}{14}\sqrt{4-\left( \left| x \right|-1 \right)^{2}}\; -\; y\; =\; 0$ looks like:

sixth factor without cut

so the sixth factor $\frac{6\sqrt{10}}{7}\; +\; \left( 1.5\; -\; .5\left| x \right| \right)\sqrt{\frac{\left| \left| x \right|-1 \right|}{\left| x \right|-1}}\; -\; \frac{\left( 6\sqrt{10} \right)}{14}\sqrt{4-\left( \left| x \right|-1 \right)^{2}}\; -\; y\; =\; 0$ looks like

sixth factor


As a product of factors is $0$ iff any one of them is $0$, multiplying these six factors puts the curves together, giving: (the software, Grapher.app, chokes a bit on the third factor, and entirely on the fourth)

Wholly Batman

link|improve this answer
50  
I tip my hat to you for this comprehensive dissection. – Willie Wong Jul 30 '11 at 14:06
75  
Holy upvotes Batman! The number of upvotes on this answer scares me. All I did was plot a bunch of equations. :-) – ShreevatsaR Jul 31 '11 at 0:41
8  
Enjoy your gold badge, dude. ;) – J. M. Jul 31 '11 at 2:50
12  
"I don’t know how ShreevatsaR did it but he sure brought a large luggage when intelligence showered the Earth." yangkidudel.wordpress.com/2011/08/02/love-and-mathematics – Jonas Meyer Aug 3 '11 at 0:15
17  
@Jonas Meyer: LOL, that's embarrassing! :P But then again, if Batman is what it takes for someone to appreciate mathematics a little, well good for Batman. :-) – ShreevatsaR Aug 3 '11 at 10:46
show 10 more comments
feedback

You may be able to see more easily the correspondences between the equations and the graph through the following graph which is from the link I got after a curious search on Google:

enter image description here

link|improve this answer
4  
Geometer's Sketchpad? – Isaac Aug 3 '11 at 18:28
@Isaac: I have no idea what software is applied. I got the picture from the link I gave in the answer. :) – Jack Aug 28 '11 at 4:20
@Isaac: Probably right. – Tim Sep 6 '11 at 12:27
feedback

Here's what I got from the equation using Maple...

enter image description here

link|improve this answer
43  
What if Commissioner Gordon uses Mathematica ???? – The Chaz Jul 30 '11 at 5:25
8  
@The Chaz: Then Commissioner Gordon should support the Mathematica SE Site Proposal on Area 51. – Isaac Jul 30 '11 at 19:22
3  
touché ....$$$$ – The Chaz Jul 30 '11 at 19:24
1  
Here's Mathematica code. See Heike's post. I tried it on M8 and it works fine. groups.google.com/group/comp.soft-sys.math.mathematica/… – Sol Aug 5 '11 at 22:48
@Sol: You can do better; see my answer. – J. M. Aug 9 '11 at 7:56
feedback

Looking at the equation, it looks like it contains terms of the form $$ \sqrt{\frac{| |x| - 1 |}{|x| - 1}} $$ which evaluates to $$\begin{cases} 1 & |x| > 1\\ i & |x| < 1\end{cases} $$

Since any non-zero real number $y$ cannot be equal to a purely imaginary non-zero number, the presence of that term is a way of writing a piece-wise defined function as a single expression. My guess is that if you try to plot this in $\mathbb{C}^2$ instead of $\mathbb{R}^2$ you will get all kinds of awful.

link|improve this answer
2  
Yeah, the equation looks too contrived to me. :) A parametric form (it's just quadratic and linear arcs sewn together, it looks) would still be messy, but not as messy. (Probably a good job for splines...) – J. M. Jul 30 '11 at 2:43
+1 i was wondering how they split it up into sections. – Ian Boyd Jul 30 '11 at 19:38
feedback

In fact, the five linear pieces that consist the "head" (corresponding to the third, fourth, and fifth pieces in Shreevatsa's answer) can be expressed in a less complicated manner, like so:

$$y=\frac{\sqrt{\mathrm{sign}(1-|x|)}}{2}\left(3\left(\left|x-\frac12\right|+\left|x+\frac12\right|+6\right)-11\left(\left|x-\frac34\right|+\left|x+\frac34\right|\right)\right)$$

This can be derived by noting that the functions

$$\begin{cases}f(x)&\text{if }x<c\\g(x)&\text{if }c<x\end{cases}$$

and $f(x)+(g(x)-f(x))U(x-c)$ (where $U(x)$ is the unit step function) are equivalent, and using the "relation"

$$U(x)=\frac{x+|x|}{2x}$$


Note that the elliptic sections (both ends of the "wings", corresponding to the first piece in Shreevatsa's answer) were cut along the lines $y=-\frac37\left((2\sqrt{10}+\sqrt{33})|x|-8\sqrt{10}-3\sqrt{33}\right)$, so the elliptic potion can alternatively be expressed as

$$\left(\left(\frac{x}{7}\right)^2+\left(\frac{y}{3}\right)^2-1\right)\sqrt{\mathrm{sign}\left(y+\frac37\left((2\sqrt{10}+\sqrt{33})|x|-8\sqrt{10}-3\sqrt{33}\right)\right)}=0$$


Theoretically, since all you have are arcs of linear and quadratic curves, the chimera can be expressed parametrically using rational B-splines, but I'll leave that for someone else to explore...

link|improve this answer
13  
...and that's half an hour of my life that I'll never get back... ;P – J. M. Jul 30 '11 at 18:47
6  
Okay, make that an hour. Sheesh. *facepalm* – J. M. Jul 30 '11 at 19:56
3  
Great, this would be much clearer. BTW, I think it's safer to leave it at "can be expressed using B-splines" than to actually try it out: who knows how many hours that will waste, right? :-) – ShreevatsaR Jul 31 '11 at 3:20
feedback

Since people (not from this site, but still...) keep bugging me, and I am unable to edit my previous answer, here's Mathematica code for plotting this monster:

Plot[{With[{w = 3*Sqrt[1 - (x/7)^2], l = (6/7)*Sqrt[10] + (3 + x)/2 - (3/7)*Sqrt[10]*Sqrt[4 - (x + 1)^2], h = (1/2)*(3*(Abs[x - 1/2] + Abs[x + 1/2] + 6) - 11*(Abs[x - 3/4] + Abs[x + 3/4])), r = (6/7)*Sqrt[10] + (3 - x)/2 - (3/7)*Sqrt[10]*Sqrt[4 - (x - 1)^2]}, w + (l - w)*UnitStep[x + 3] + (h - l)*UnitStep[x + 1] + (r - h)*UnitStep[x - 1] + (w - r)*UnitStep[x - 3]], (1/2)*(3*Sqrt[1 - (x/7)^2] + Sqrt[1 - (Abs[Abs[x] - 2] - 1)^2] + Abs[x/2] - ((3*Sqrt[33] - 7)/112)*x^2 - 3)*((x + 4)/Abs[x + 4] - (x - 4)/Abs[x - 4]) - 3*Sqrt[1 - (x/7)^2]}, {x, -7, 7}, AspectRatio -> Automatic, Axes -> None, Frame -> True, PlotStyle -> GrayLevel[0]]

This should work even for versions that do not have the Piecewise[] construct. Enjoy. :P

link|improve this answer
feedback

The following is what I got from the equations using MATLAB: enter image description here


Here is the M-File (thanks to this link):

clf; clc; clear all; 
syms x y

eq1 = ((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);
eq2 = (abs(x/2)-((3*sqrt(33)-7)/112)*x^2-3+sqrt(1-(abs(abs(x)-2)-1)^2)-y);
eq3 = (9*sqrt(abs((abs(x)-1)*(abs(x)-.75))/((1-abs(x))*(abs(x)-.75)))-8*abs(x)-y);
eq4 = (3*abs(x)+.75*sqrt(abs((abs(x)-.75)*(abs(x)-.5))/((.75-abs(x))*(abs(x)-.5)))-y);
eq5 = (2.25*sqrt(abs((x-.5)*(x+.5))/((.5-x)*(.5+x)))-y);
eq6 = (6*sqrt(10)/7+(1.5-.5*abs(x))*sqrt(abs(abs(x)-1)/(abs(x)-1))-(6*sqrt(10)/14)*sqrt(4-(abs(x)-1)^2)-y);


axes('Xlim', [-7.25 7.25], 'Ylim', [-5 5]);
hold on

ezplot(eq1,[-8 8 -3*sqrt(33)/7 6-4*sqrt(33)/7]);
ezplot(eq2,[-4 4]);
ezplot(eq3,[-1 -0.75 -5 5]);
ezplot(eq3,[0.75 1 -5 5]);
ezplot(eq4,[-0.75 0.75 2.25 5]);
ezplot(eq5,[-0.5 0.5 -5 5]);
ezplot(eq6,[-3 -1 -5 5]);
ezplot(eq6,[1 3 -5 5]);
colormap([0 0 1])

title('Batman');
xlabel('');
ylabel('');
hold off
link|improve this answer
feedback

Here's the equations typed out if you want save time with writing it yourself.

(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=0
ABS(x/2)-((3*SQRT(33)-7)/112)*x^2-3+SQRT(1-(ABS(ABS(x)-2)-1)^2)-y=0
9*SQRT(ABS((ABS(x)-1)*(ABS(x)-0.75))/((1-ABS(x))*(ABS(x)-0.75)))-8*ABS(x)-y=0
3*ABS(x)+0.75*SQRT(ABS((ABS(x)-0.75)*(ABS(x)-0.5))/((0.75-ABS(x))*(ABS(x)-0.5)))-y=0
2.25*SQRT(ABS((x-0.5)*(x+0.5))/((0.5-x)*(0.5+x)))-y=0
(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=0

Also: http://pastebin.com/x9T3DSDp

link|improve this answer
The multiple "=0" lines are different than the mulitiplications in the original, there are some backslashes in there that throw things off, and the formatting is hard to read. The pastebin is better. – nealmcb Jul 30 '11 at 16:42
I've made a meta post about this answer. – Zev Chonoles Jul 30 '11 at 19:21
2  
I would have commented it but I don't have enough rep to comment :P – stoicfury Jul 31 '11 at 4:45
feedback

protected by Zev Chonoles Jul 30 '11 at 19:53

This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.

Not the answer you're looking for? Browse other questions tagged or ask your own question.