Circle-Rectangle Intersection (Collision)

Simon has been studying  various 2D collisions (via the p5.collide2D library and, especially the Circle-Rectangle Intersection (Collision). He was so busy with this problem that he even put it down in chalk at the playground:





And on the whiteboard at home:


And spent nearly his entire math lesson today talking about the math behind 2D object collision to his math teacher:





Simon also used Circle-Rectangle Collision for his awesome new Hero Game in Processing!


How to double a cube?

We continue reading the Russian adventurous math books by  Vladimir Levshin (1904-1984) – see an older post about it – and Simon is often excited about the challenges discussed. This time however, he first thought that something was impossible (and the Russian book said that, too), but our amazing favourite Murderous Math thought otherwise! It was one of the three oldest “unresolved” problems in the world, about how to double a cube (and let it remain a cube), which basically boils down to “how to draw the cube root of 2”:






Some more unrelated notes that Simon made recently, while listening to the Russian adventurous math book:



Simon’s Codea Tutorials and the Arc-Tangent

A set of awesome Codea tutorials that Simon recorded for those who are just starting to program in Codea. Simon ported examples from Processing (java) into Codea (Lua):

In the second tutorial (in two parts), Simon explains how to write a physics simulation program in Codea using forces like gravity, friction and spring force. Anyone watching will get to use some trigonometry and see what arc-tangent is for! The original code in Java comes from Keith Peters (Processing).

Here are some notes from when Simon was explaining the arc-tangent to me the other day:



Solar System in Processing Coding Challenge

Simon returned to the Solar System in Processing Coding Challenge by Daniel Shiffman – something he tried before and got stuck. He has now successfully completed both the 2D and the 3D parts:






Magnitude of a 3D vector

Here Simon explains how to calculate the magnitude of a 3D vector. This is something he partially figured out on his own and partially learned from Daniel Shiffman’s tutorial on Trigonometry and Polar Coordinates.



Translating Car On Terrain project from into Processing

Today Simon spent hours translating this Car On Terrain project from (where it appears in JavaScript) into Processing (Java). He loved doing it in a form of a lesson for me, while I was filming him and asking questions about loops, arrays, fixtures, shapes and bodies (and there are many things I don’t understand). Simon also spoke about “the three most important properties: density, friction and restitution”. The project involved a lot of Physics, using many Box2D sub-libraries and translating between pixels and mm.

In the end, he got tired of writing all the coordinates for the terrain vertices, but he did get quite far.






Applying Box2D to translate from pixels into mm:

CarOnTerrain translating from pixels into mm