How is this possible, technically? What is the logic behind this?
[Math] The Magic Chocolate Bar illusion
geometry
Related Solutions
We run into definitional trouble quickly.
I don't think we can usefully separate the concept of an "optical illusion" from the fact that your brain contains a mechanism for reconstructing a 3D scene given a 2D stimulus received at your retina. An optical illusion is when this mechanism almost but not quite can construct a 3D hypothesis that matches the mechanism. (A completely nonsensical jumble of lines, lights and shadows is not an illusion).
As such, the very idea of "optical illusion" is tightly dependent on the limits of, specifically, the human brain as a means of reconstructing 3D scenes, and it's not clear that we would even agree with other 3D creatures what good optical illusions are.
Note especially that the brain is fallible and sometimes creates a wrong model, or claims that the stimumus is impossible when it is actually produced by a real 3D scene. For example many of the images you get from a Google Image search for "impossible box" (try it) are photographs of real, physical objects that have been carefully constructed to look like illusions (when seen from the right angle and in the right lighting). So we can't just define "illusion" as a 2D stimulus that looks like it was generated by a 3D scene locally but can't possibly be created by a real 3D object.
But if we can't even agree with other 3D beings what an optical illusion is, what hope have we of predicting which kind of 4D scenes the brain of a hypothetical 4D creature will consider "reasonable enough" explanations of a 3D picture that they don't count as illusions to him?
Bonus musings: There are even arguments that it is not even biologically intrinsic to being human to be able to view a flat perspective image (say, at an angle, or from the wrong distance to work as an actual trompe-l'oeil) and decode its content accurately -- rather it is a learned skill that depends on familiarity with such images.
Even stronger, the illusory content of the "impossible fork" construction depends on conventions about contour drawings that certainly have a cultural component. It is technologically possible to imagine a future where line drawings are a lost art (or perhaps only appreciated by a small highbrow elite) and every picture of 3D scenes the average citizen sees in daily life aims for photorealism, whether they are actual photographs or CGI. Would someone who grows up in such a culture even be able to recognize the impossible fork as making sense locally?
Say the square had side $s$. The diagonal has length $\sqrt 2 s$ so we have $$s+\sqrt 2 s = 8 \implies s(\sqrt 2 +1)=8\implies s=\frac 8{\sqrt 2 +1}=8\times (\sqrt 2 -1)$=8\sqrt 2 - 8$$
Now, in your (isosceles) right triangle, the hypotenuse is $8\sqrt 2$ and the side is $8$ so the desired claim follows at once.
Best Answer
If you look at the southwest corners of the two trapezoidal pieces, the larger piece (that starts on the left) has a bigger part of a chocolate square than the smaller piece. However, when they swap places the smaller piece jumps into place, growing a bit as it arrives. The animation is fast and jerky, concealing the small error.