465

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

Batman logo

Batman Equation in text form: \begin{align} &\left(\left(\frac x7\right)^2\sqrt{\frac{||x|-3|}{|x|-3}}+\left(\frac y3\right)^2\sqrt{\frac{\left|y+\frac{3\sqrt{33}}7\right|}{y+\frac{3\sqrt{33}}7}}-1 \right) \\ &\qquad \qquad \left(\left|\frac x2\right|-\left(\frac{3\sqrt{33}-7}{112}\right)x^2-3+\sqrt{1-(||x|-2|-1)^2}-y \right) \\ &\qquad \qquad \left(3\sqrt{\frac{|(|x|-1)(|x|-.75)|}{(1-|x|)(|x|-.75)}}-8|x|-y\right)\left(3|x|+.75\sqrt{\frac{|(|x|-.75)(|x|-.5)|}{(.75-|x|)(|x|-.5)}}-y \right) \\ &\qquad \qquad \left(2.25\sqrt{\frac{(x-.5)(x+.5)}{(.5-x)(.5+x)}}-y \right) \\ &\qquad \qquad \left(\frac{6\sqrt{10}}7+(1.5-.5|x|)\sqrt{\frac{||x|-1|}{|x|-1}} -\frac{6\sqrt{10}}{14}\sqrt{4-(|x|-1)^2}-y\right)=0 \end{align}

Cookie
  • 12,810
  • 14
  • 54
  • 126
a_hardin
  • 5,499
  • 3
  • 13
  • 7
  • 149
    Why don't you just try it? – JT_NL Jul 29 '11 at 21:19
  • 150
    @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
  • 3
    @Zev: thanks for the tip. I didn't know about that feature. Now the post has an unbelievable 51 upvotes, which is clearly way out of proportion. – Cheerful Parsnip Jul 30 '11 at 17:18
  • 11
    @Zev Chonoles: i do not know of any web-site that can plot that equation. i wouldn't know where to begin. Also i don't understand *how* any solver could plot such a diagram. (Hence the question). – Ian Boyd Jul 30 '11 at 19:35
  • OK - so here's the full Batman equation in Mathematica format. Proofread a couple of times in "traditional" format. I tried to get this to work with `ContourPlot[theEquation,{x,-7,7},{y,-3,3}]` and got a blank plot. Then I had the idea of forcing only the real part of the equation by plotting `ContourPlot[Re[theEquationBeforeEqualsSign]==0,{x,-7,7},{y,-3,3}]`. Doing this shows that the equations work, but Mathematica's butchering it. Any suggestions to get Mathematica to make it look nice? –  Jul 30 '11 at 18:41
  • There are test functions on a TI-84 (<,>,≤,≥) which return 1 when true, which bounds the pieces nicely. I've spent a few minutes converting them to GC friendly equations. `Y1 = (.75+3|X|)(|X|≤.75)(|X|≥.5)+(9-8|X|)(|X|≤1)(|X|≥.75)+2.25(|X|≤.5) Y2 = (7-3√33)X²/112+|X/2|-3+√(1-(||X|-2|-1)²) Y3 = ((6√10)(1-.5√(4-(|X|-1)²))/7+(3-|X|)/2)(|X|≥1)(|X|≤3) Y4 = {-(|X|≥4),(|X|≥3)}3√(1-x²/49)` –  Jul 30 '11 at 17:30
  • 6
    The question is not (for me) "does this work?" but rather "*how* does it work?", for which ShreevatsaR provided an excellent reply. Trying it out in a program won't answer that question. – bart Jul 30 '11 at 20:27
  • 236
    I don't understand why this question has so many upvotes. – JT_NL Aug 03 '11 at 18:36
  • 4
    @Jonas Teuwen: You can contribute to the discussion at http://meta.math.stackexchange.com/questions/2707/whats-going-on-with-this-batman-question if you like. – Jonas Meyer Aug 03 '11 at 18:56
  • 58
    @Jacob http://www.wolframalpha.com/input/?i=batman+equation – splattne Aug 31 '11 at 14:40
  • Corollary: Can you make google's graphing calculator plot it? – keflavich Dec 05 '11 at 20:50
  • 2
    We've just had this one on TeX-SX. Here's the batman logo in TikZ: http://tex.stackexchange.com/q/47388/86 – Andrew Stacey Mar 09 '12 at 13:00
  • 6
    The fact that this questio is the most up voted means that up votes are not so important in this site. – checkmath Jul 26 '12 at 19:33
  • 3
    math is funny. to see 'the Pamela Anderson profile' google: exp(-((x-4)^2+(y-4)^2)^2/1000) + exp(-((x+4)^2+(y+4)^2)^2/1000) + 0.1exp(-((x+4)^2+(y+4)^2)^2)+0.1exp(-((x-4)^2+(y-4)^2)^2) – Helder Velez Aug 20 '12 at 19:01
  • 2
    This question does not only seem to be the one with the most views, but also the one with the most downvotes (currently 46). – Dominik Dec 08 '12 at 22:29
  • 1
    There's also a mathematical expression for the superman insignia, [Superman](http://www.wolframalpha.com/input/?i=superman+equation) – Rustyn Dec 28 '12 at 18:54
  • 1
    @JonasTeuwen Because Batman. – temporary_user_name Mar 19 '13 at 19:51
  • 4
    More logos equations on Alpha: http://www.wolframalpha.com/input/?i=logo+laminae – Jean-Claude Arbaut Mar 27 '13 at 19:35
  • 4
    You should try it out yourself (-1). – Abhimanyu Pallavi Sudhir Jul 09 '13 at 15:45
  • 5
    No efforts and still one of the most up-voted questions on M.S.E.. :( – Apurv Apr 03 '14 at 17:09
  • 1
    Wolfram alpha has a bunch of "Pokemon Curves" made with parametric equations: [Pikachu Curve on wolfram alpha](http://www.wolframalpha.com/input/?i=pikachu+curve) – Shaurya Gupta Apr 09 '14 at 08:42
  • 3
    To those who criticize the OP for not plotting the curve himself: I currently only know how to use Mathematica, and Mathematica 7 has no default way of plotting curves defined by *implicit* equations. This might be possible using 3rd party modules, but this is clearly out of reach for most casual users. – Alex M. Dec 31 '16 at 11:37

10 Answers10

1082

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

ShreevatsaR
  • 39,794
  • 7
  • 90
  • 125
  • 1
    Indeed, with your analysis, we see that "Batman's curve" is a true chimera. On that note, $|x|=x\,\mathrm{sign}\,x$, so if your environment supports a sign function, you can simplify the equations a bit. Now, I wonder if a less-contrived algebraic equation might exhibit that very shape... BTW, what did GrafEq have to say about this curve? ;) – J. M. ain't a mathematician Jul 30 '11 at 05:24
  • @J. M.: Heh, I did try it on GrafEq first. :-) But it was under Wine on Mac OS X so it kept crashing, also I couldn't get it to show the "doubtful" regions in a different colour from the "confirmed" ones, so I gave up. Good idea about replacing the terms $\sqrt{|x|/x}$ everywhere by $\sqrt{\mathrm{sgn}(x)}$. It does make the equations shorter, and doesn't seem to make, in Grapher.app, any difference to the plots. – ShreevatsaR Jul 30 '11 at 08:58
  • 187
    I tip my hat to you for this comprehensive dissection. – Willie Wong Jul 30 '11 at 14:06
  • +∞ :) I'd love to see this changed to .... = z, and plotted with shading based on the z values. – nealmcb Jul 30 '11 at 16:49
  • @neal: I don't expect the surface to exist; the "curve" is already very contrived as it is. – J. M. ain't a mathematician Jul 30 '11 at 19:00
  • 4
    If there were only no rep-cap, Shree would be swimming in rep now... ;P – J. M. ain't a mathematician Jul 30 '11 at 19:56
  • Since, there's a YComb post as you said, @Willie, it seems likely. :) – J. M. ain't a mathematician Jul 30 '11 at 21:59
  • 40
    "I don’t know how ShreevatsaR did it but he sure brought a large luggage when intelligence showered the Earth." http://yangkidudel.wordpress.com/2011/08/02/love-and-mathematics/ – Jonas Meyer Aug 03 '11 at 00:15
  • 47
    @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 03 '11 at 10:46
  • @Shr: What software did you use to draw the graph? Mathematica? –  Aug 03 '11 at 17:27
  • 4
    @Jack: [Grapher](http://en.wikipedia.org/wiki/Grapher), which comes by default on Mac OS X. I mentioned it in the answer actually, just before the last figure. – ShreevatsaR Aug 03 '11 at 17:34
  • 4
    Okay, now do this one: [PSY curve](http://www.wolframalpha.com/input/?i=PSY+curve). – Douglas S. Stones May 23 '13 at 00:31
  • 1
    I can see a lot of people learning a lot just from this dissection, bravo ShreevatsaR. – F.Webber Jan 02 '14 at 21:06
  • 3
    I just found out that the curve was devised by J. Mathew Register (then "teaching at a few art schools throughout the greater Sacramento area", now "a full time professor over at American River College"): https://www.quora.com/Who-wrote-the-Batman-equation/answer/J-Matthew-Register – ShreevatsaR Sep 11 '15 at 23:03
220

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

enter image description here

  • 12
    Geometer's Sketchpad? – Isaac Aug 03 '11 at 18:28
  • @Isaac: Probably right. – Tim Seguine Sep 06 '11 at 12:27
  • 2
    to see the graph just google the equation: 2*sqrt(-abs(abs(x)-1)*abs(3-abs(x))/((abs(x)-1)*(3-abs(x))))(1+abs(abs(x)-3)/(abs(x)-3))sqrt(1-(x/7)^2)+(5+0.97(abs(x-.5)+abs(x+.5))-3(abs(x-.75)+abs(x+.75)))(1+abs(1-abs(x))/(1-abs(x))),-3sqrt(1-(x/7)^2)sqrt(abs(abs(x)-4)/(abs(x)-4)),abs(x/2)-0.0913722(x^2)-3+sqrt(1-(abs(abs(x)-2)-1)^2),(2.71052+(1.5-.5abs(x))-1.35526sqrt(4-(abs(x)-1)^2))sqrt(abs(abs(x)-1)/(abs(x)-1))+0.9 – Helder Velez Aug 20 '12 at 18:47
  • what program is that? – Joao Apr 04 '14 at 07:19
  • 4
    @HelderVelez 2014: _"'abs' (and any subsequent words) was ignored because we limit queries to 32 words."_ - Google – Baby Nov 28 '14 at 08:11
  • @Jonjongot check the Patel answer (equal to my comment), and past the equation to the google search text window. The batman graph will appear then. (in my eq the symbol '–' following the last 0.9 do not belong to the eq). My google chrome browser accepts much more than 32 words. – Helder Velez Nov 30 '14 at 23:00
  • @HelderVelez Ah! now I can see it :D – Baby Dec 01 '14 at 01:07
  • 1
    x1(y), x2(y) should be 7 * sqrt( 1 - y^2 / 9) and -7 * sqrt( 1 - y^2 / 9), respectively – moorepants Jun 25 '17 at 04:39
86

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

enter image description here

GEdgar
  • 96,878
  • 7
  • 95
  • 235
67

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.

Willie Wong
  • 68,963
  • 11
  • 143
  • 246
  • 5
    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. ain't a mathematician Jul 30 '11 at 02:43
  • +1 i was wondering *how* they split it up into sections. – Ian Boyd Jul 30 '11 at 19:38
  • 29
    " My guess is that if you try to plot this in C2 instead of R2 you will get all kinds of awful." What did you expect? The analytic continuation of the Batman symbol?? – jwg Aug 01 '13 at 08:43
55

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 = (3 (Abs[x - 1/2] + Abs[x + 1/2] + 6) -
                 11 (Abs[x - 3/4] + Abs[x + 3/4]))/2, 
            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) (Sign[x + 4] - Sign[x - 4]) - 3*Sqrt[1 - (x/7)^2]},
     {x, -7, 7}, AspectRatio -> Automatic,  Axes -> None, Frame -> True,
     PlotStyle -> Black]

Mathematica graphics

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

J. M. ain't a mathematician
  • 71,951
  • 6
  • 191
  • 335
46

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...

J. M. ain't a mathematician
  • 71,951
  • 6
  • 191
  • 335
45

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
24

The 'Batman equation' above relies on an artifact of the plotting software used which blithely ignores the fact that the value $\sqrt{\frac{|x|}{x}}$ is undefined when $x=0$. Indeed, since we’re dealing with real numbers, this value is really only defined when $x>0$. It seems a little ‘sneaky’ to rely on the solver to ignore complex values and also to conveniently ignore undefined values.

A nicer solution would be one that is unequivocally defined everywhere (in the real, as opposed to complex, world). Furthermore, a nice solution would be ‘robust’ in that small variations (such as those arising from, say, roundoff) would perturb the solution slightly (as opposed to eliminating large chunks).

Try the following in Maxima (actually wxmaxima) which is free. The resulting plot is not quite as nice as the plot above (the lines around the head don’t have that nice ‘straight line’ look), but seems more ‘legitimate’ to me (in that any reasonable solver should plot a similar shape). Please excuse the code mess.

/* [wxMaxima batch file version 1] [ DO NOT EDIT BY HAND! ]*/
/* [ Created with wxMaxima version 0.8.5 ] */

/* [wxMaxima: input   start ] */
load(draw);
/* [wxMaxima: input   end   ] */

/* [wxMaxima: input   start ] */
f(a,b,x,y):=a*x^2+b*y^2;
/* [wxMaxima: input   end   ] */

/* [wxMaxima: input   start ] */
c1:sqrt(26);
/* [wxMaxima: input   end   ] */

/* [wxMaxima: input   start ] */
draw2d(implicit(
f(1/36,1/9,x,y)
+max(0,2-f(1.5,1,x+3,y+2.7))
+max(0,2-f(1.5,1,x-3,y+2.7))
+max(0,2-f(1.9,1/1.7,(5*(x+1)+(y+3.5))/c1,(-(x+1)+5*(y+3.5))/c1))
+max(0,2-f(1.9,1/1.7,(5*(x-1)-(y+3.5))/c1,((x-1)+5*(y+3.5))/c1))
+max(0,2-((1.1*(x-2))^4-(y-2.1)))
+max(0,2-((1.1*(x+2))^4-(y-2.1)))
+max(0,2-((1.5*x)^8-(y-3.5)))
-1,
x,-6,6,y,-4,4));
/* [wxMaxima: input   end   ] */

/* Maxima can't load/batch files which end with a comment! */
"Created with wxMaxima"$

The resulting plot is: enter image description here

(Note that this is, more or less, a copy of the entry I made on http://blog.makezine.com.)

copper.hat
  • 161,568
  • 8
  • 96
  • 225
  • I really think that an indeterminate value multiplied by zero equals zero, so it seems to be legit. Is there any reason 0 * 0/0 should not be defined to be zero? – dbanet Jun 15 '15 at 19:45
  • @dbanet: What are you referring to? The issue above is that the original equations rely on the plotting software ignoring undefined values, which is peculiar, to say the least. The expression $\sqrt{\frac{|x|}{x}}$ (with $x$ being replaced by some expression) is what I referred to and it appears without being multiplied by $x$. – copper.hat Jun 15 '15 at 19:54
  • @copper-hat: The function $f(x)=\sqrt{\frac{|x|}{x}}$ appears only in boolean expressions $F:x\to \{\text{True},\text{False}\}$ of form $f(x)g(x)=0$, so if $g(x)$ is defined as $g:x\in\mathbb{C}\to{0}$, I would rather evaluate $F(0)$ to $\text{True}$ than to $\text{False}$, as $\forall{x}:f(x)g(x)=0\Longleftrightarrow \Big(f(x)=0\lor g(x)=0\Big)$. – dbanet Jun 15 '15 at 21:57
  • @dbanet: I'm really not sure what you are getting at. Look at the expressions in the question. They rely on the expression $\sqrt{\frac{|x|}{x}}$ returning zero for $x \le 0$, which is strange (look at Willie's answer http://math.stackexchange.com/a/54521/27978). My answer plots level sets, which avoids this whole issue. – copper.hat Jun 15 '15 at 22:10
  • @copper-hat: Why is it strange? For $x<0:\operatorname{Im}\left(\sqrt{\frac{|x|}{x}}\right)\neq{0}$. For $x=0$ it is indeterminate but that does not matter as long as any other factor evaluates to zero, so that the whole boolean expression holds. – dbanet Jun 15 '15 at 22:16
  • 1
    @dbanet: I don't really get your point. In the formula in the question there are lots of expressions of the above form that are multiplied by quantities that do not evaluate to zero when $x<0$. If they did, there would be no need to have the strange expression in the first place. – copper.hat Jun 15 '15 at 22:21
  • @copper-hat: In your answer you state that "the solver ignores complex and indeterminate values". That is not true. Can you please give an example point $(x;y)$ which belongs to the plot constructed by a (bad) plotting program, but only due to the fact that "the solver ignores complex and indeterminate values"? – dbanet Jun 15 '15 at 22:32
  • @dbanet: Look at this answer to see what is happening: http://math.stackexchange.com/a/54568/27978. The plot is composed of sections that are, in my opinion, artificially stitched together using the 'ignore if complex' plotting approach. There are lots of example points in the answer at the start of this comment. It would help me answer your question if you could tell me what you trying to get at. – copper.hat Jun 15 '15 at 22:40
  • @copper-hate: Can you please give an example point which belongs to the plot constructed by a (bad) plotting program, but only due to the fact that "the solver ignores complex and indeterminate values"? There is nothing that is "ignored" by the plotter. The complex or indeterminate value is getting multiplied by zero. – dbanet Jun 15 '15 at 22:42
  • @dbanet: No need to be rude. I never wrote that the plotting program was bad. If you take $x=3$ in the first ellipse, then the quantity $\left( \frac{x}{7} \right)^{2}\sqrt{\frac{\left| \left| x \right|-3 \right|}{\left| x \right|-3}}$ is indeterminate and is not multiplied by zero. – copper.hat Jun 15 '15 at 22:52
  • @copper-hat: I'm sorry, never meant to be rude to you. Indeed, no multiple at point e. g. $(3;1)$ evaluates to zero, so the whole LHS evaluates to indeterminate due to the first multiple, so one can't determine whether to include the $(3;1)$ point to the plot or not. Thank you. – dbanet Jun 15 '15 at 23:30
  • @dbanet: I was kidding; you wrote at-copper-hate above... – copper.hat Jun 15 '15 at 23:48
  • @copper-hat: Oops a typo. :P – dbanet Jun 16 '15 at 00:06
17

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

stoicfury
  • 467
  • 3
  • 6
  • 12
  • 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
  • 1
    I've made a [meta post](http://meta.math.stackexchange.com/questions/2709) 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 04:45
6

Sorry but this is not the answer but too long for a comment: Probably the easiest verification is to type the equation on Google you'l be surprised : The easiest way is to Google :2 sqrt(-abs(abs(x)-1)abs(3-abs(x))/((abs(x)-1)(3-abs(x))))(1+abs(abs(x)-3)/(abs(x)-3))sqrt(1-(x/7)^2)+(5+0.97(abs(x-.5)+abs(x+.5))-3(abs(x-.75)+abs(x+.75)))(1+abs(1-abs(x))/(1-abs(x))),-3sqrt(1-(x/7)^2)sqrt(abs(abs(x)-4)/(abs(x)-4)),abs(x/2)-0.0913722(x^2)-3+sqrt(1-(abs(abs(x)-2)-1)^2),(2.71052+(1.5-.5abs(x))-1.35526sqrt(4-(abs(x)-1)^2))sqrt(abs(abs(x)-1)/(abs(x)-1))+0.9

Shivam Patel
  • 3,966
  • 2
  • 21
  • 37
  • @copper, it is just because of the algorithm that `draw` uses for drawing implicit functions. You need to setup the variables `ip_grid` and `ip_grid_in`, that are the sampling values in your region. For example ```draw2d(ip_grid=[60,60], ip_grid_in=[20,20], implicit(y^2=x^3-2*x+1, x, -4,4, y, -4,4) );``` – nicoguaro Oct 16 '14 at 19:21