Optical Illusions in Processing (Java)

Simon created three optical illusions in Processing (Java) playing with color. For better effect, you can download Simon’s code on GitHub: https://github.com/simon-tiger/colorIllusions

The Part 1 video is about the first two illusions. The third (and the coolest) illusion is in Part 2.


Simon writes:
Illusion 1: A checkerboard with blue and yellow squares, but if you move away from it, you see white.
Illusion 2
Mode 1: A disk with red and green, but when you spin it, it becomes yellow.
Mode 2: A disk with red and cyan, but when you spin it, it disappears.
Illusion 3: A rainbow of colors, but when you pause it from flickering, you only see red, green, and blue.

If Illusion 2 Mode 2 doesn’t work, change the background from 255 to between 128 and 135.
If any of the other illusions don’t work, try doing them on a different screen.

Inspired by Physics Girl videos.




Simon turned 9!

– Simon, Mom and Dad arranged it quite nicely, to have your birthdat and our wedding anniversary on two consecutive days!

– No, it was pure coincidence!

– But what was the chance that Mom and Dad’s wedding dat was one day before or after your birthday?

– One in 182.62125 exactly! It’s because in the Gregorian calendar, a year lasts exactly 365.2425 days.

Color Opposites

Here Simon placed the primary colors in the next to the secondary ones (that he mixed using only the three primary colors) so that the colors that are absolute opposites of each other are also standing opposite to each other: blue is the opposite of yellow, magenta is the opposite of green and red is the opposite of cyan.

How much iron is there in your favorite cereal?

If you put a cereal flake in a bowl of water you can steer it with a strong magnet. The magnets above aren’t strong enough, but the really powerful ones below (that are dangerous to pull apart as they can actually injure you) are:

And if you grind the cereal into powder, the powder sticks to the magnet because of the iron atoms in the cereal:

Inspired by the Veritasium channel.

Experimenting with electromagnetism

Here Simon tried to induce a magnetic field by allowing electric current to go through a conductor that is normally not magnetic (copper wire). The green stick is a magnet that got attracted to it once the circuit closed.

The copper wire also began to slightly attract the steel paperclips.