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.

 

 

Advertisements

Simon’s Archimedean Solids Project

https://youtu.be/dYBZXFW4bsg

Simon is working on a project that will involve constructing the Archimedean solids from paper pieces that he programs in Processing (Java) and prints out. In the previous video, Simon worked out the distance between two points to measure the side length of a pentagon that has the radius of 1 (i.e. the distance between its adjacent vertices if the distance from its center to its vertices is 1). He first made a mistake in his calculation and got a result that would be true for a hexagon, not a pentagon. He then corrected himself and got the value that he thought he could use in the Processing code, but as it turned out, the ratio between the radius and the side length was still not right. We recorded a whole new video full of calculations and playing with the code, and achieved pretty neat results after Simon used the new value in the code, but still not good enough, as Simon wanted to have his pentagons to have the side length of 40 (to match the triangles and the squares he’d already made). Simon later found a solution using a different formula for a polygon with n sides (from trigonometry, defining the radius as the side length over (2sin times 180/n)) and succeeded in getting exactly the pentagons he wanted, with the side equalling 40. See the result here:

https://www.youtube.com/watch?v=f4unEptU3Vs&t=1s

The winning formula:

If you are really into working out the calculations, feel free to check out our frantic attempts here:

https://youtu.be/TuVqc5A08es

Live Stream #18. Living Code, Chapter 6: Particle Systems. 99 Balls Game.

Simon says: “In this live session, I am continuing Chapter 6 of my “Living Code” Course. This is the 4th live stream that I’m attempting to do this”. It was a tough one again, many thanks to Nahuel José for helping Simon out with an error! In the end Simon did manage to finish the second video in Particle Systems, but got another error in his third video in this chapter, so please feel free to help out if you have a minute to look at his code: https://alpha.editor.p5js.org/simontiger/sketches/HJK_bEjCf

Simon also started working on a “99 Balls” game. The next stream will be in two weeks, on July 24!

Live Stream #16: Twins Game in Processing and Chapter 6 of Living Code.

Simon’s live stream yesterday had several supportive viewers. Simon started making a game of Twins in Processing (Java) and went on with his JavaScript course Living Code, that is based on Daniel Shiffman’s Nature of Code. He tries to keep his live sessions concise now, no longer than 1,5 hours. Note that in the summer, all the live streams will be in Tuesdays in order not to clash with Daniel Shiffman’s summer schedule.

Simon’s Times Tables Visualization

Times Tables Visualization 31 May 2018

Simon shows his Times Tables Visualization in Processing (Java) and talks about how it’s connected to Mandelbrot Set. See the code with the README on GitHub: https://github.com/simon-tiger/times_tables

View the full animation here:

 

Simon writes: This is a visualization for the times tables from 1 to 200 (including the in-between numbers that are multiples of .01). I used modular arithmetic to write the code:

0. Start with a circle with 200 points (I’ve chosen 200, your number could be anything, but we’ll use 200 in the instructions).

1. Label the points from 0-199, then from 200-399, then from 400-599, and so on (you’re labeling the same point several times).

2. We’ll first do the 2x table. 2×0=0, same thing so we don’t do anything. 2×1=2, so we connect 1 to 2. 2×2=4, so we connect 2 to 4, and so on.

3. 2×100=200, where’s the 200? It goes in a circle so 200 is where the 0 is, and now you can keep going.

4. Now you could keep going beyond 199, but actually, you’re going to get the same lines you already had!

5. You can now create separate images for the 2x table (which we’ve just done), the 3x table, the 4x table, the 5x table, and so on. You can even try in-between numbers (like 2.53) if you want.

In the program, you see an animated image at the left of the screen, and 4 static images (representing examples of times tables) to the right of that. They represent the 2x, 34x, 51x and 99x tables.

The idea of a times tables visualization comes from a video by Mathologer, but the code Simon wrote completely on his own.

Live Stream #15. Chapter 6 of Living Code: Particle Systems

Simon’s latest Live Stream about Chapter 6 of his “Living Code” Course (particle systems!), loosely based on Daniel Shiffman’s Nature of Code. “I’m also going to live stream a surprise maths video”, – at the beginning of the stream Simon devoted some time to the magic hexagon problem.

Live Stream #14. 15’s Puzzle Redo continued.

In this live session, Simon continue my 15s puzzle redo live session (“yet again, but I swear this is going to be the last time I do this!” Simon said). Here’s a link to the previous part. This week’s live stream went great, Simon kept it concise, didn’t panic while debugging, largely thanks to a wonderful supportive audience. And he even got some interesting personal questions asked in the end!

Reds and Greens

Simon has crafted a nice game today, inspired by a video in which mathematician Katie Steckles shows several mathematical games. Simon wasn’t sure what the game was called so he named it “Reds and Greens”. The objective of the game is to accumulate a set of three cards sharing the same property (such as the same number of green dots or red dots, the same total number of reds and greens or a set in which all the three possible variants – one, two and three dots of the same color – would be present). Each player pulls a card from the stack (all the cards are lying face up) and the one who collects a set first wins. Simon has actually programmed the cards in Processing (Java) – quite a strenuous task. Below is the jpeg pic of what he made and his code in Processing.

Reds and Greens 10 Apr 2018

 

Reds and Greens Code 1 10 Apr 2018Reds and Greens Code 2 10 Apr 2018

Simon also explained how the game is very similar to Tic Tac Toe, look at the photo below and you’ll see why:

dsc_0935181490489.jpg

Live Stream #12: 15’s Puzzle Redo

Simon had quite an audience yesterday during his live lesson. In this week’s session, Simon remade his 15’s Puzzle in Processing and explained the math behind it. He plans to finish the puzzle during his next live stream in two weeks from now (on April 19 at 17:15 CET).

 

Tantrix Game in JavaScript

Simon talking about his Tantrix Game code and the math behind it. It has been Simon’s first community project, many thanks to everyone who has contributed hexagonal tiles for the game! The game isn’t finished yet, but the video gives a good insight into the work in progress. Simon will finish it at a later date he says. Feel free to try and finish it on your own and share your results! The code is on GitHub at: https://github.com/simon-tiger/tantrix

This is a separate link to see what Simon has got so far in action: https://simon-tiger.github.io/tantrix/tantrix/

 

Below is Simon’s original YouTube post summoning contributions: