Codea, Coding, Geometry Joys, Java, Milestones, Murderous Maths

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:

DSC_0716

 

Coding, Geometry Joys, JavaScript, Physics, Simon makes gamez, Simon's Own Code

Spring Animation Tool (Simon’s own code)

The next exciting step in writing his own code about spring force: Simon actually created an interface to allow anyone to build his own shape made of springs and particles! Simon put this project on GitHub and hosted it to make it accessible online.

The code: https://github.com/simon-tiger/spring-animation-tool

The online interface to play with: https://simon-tiger.github.io/spring-animation-tool/

He also wrote the instructions himself and placed them in the GitHub Wiki: https://github.com/simon-tiger/spring-animation-tool/wiki/Intro

Intro Spring Animation Tool 24 Apr 2017

Videos of the project step by step:

Simon doesn’t consider this project finished. He wants to come up with a way to apply spring force to all the springs simultaneously to make sure the shape’s sides are equal in the final stage.

Coding, Geometry Joys, JavaScript, Physics, Simon's Own Code

Soft Springs (Simon’s own code)

Simon used Chapter 3 (Oscillation) of Daniel Shiffman’s book The Nature of Code as the theoretical basis for creating his own code. First, he played around with what he calls “soft springs” – multiple spring arrays connecting multiple particles (some of them locked but most of them moving) – allowing for most interesting designs thanks to spring force.

Simon called the video below “a mess” that “doesn’t look promising”, but to me it’s my favourite pattern. To me it resembles a constructivist poster turned alive, something like an El Lissitzky animation:

Other soft springs step by step (Simon explains what soft springs are in the first video):

Simon eventually stepped over t trying to create sets of springs and particles that unfold into certain geometrical shapes, like a trapezoid here:

And finally, a hexagon: