Simon came up with a tool (a circle where you install a pencil) to draw curved lines. He explains how the curved line actually draws the absolute value of the Sine function sin(x). “Because an absolute value of x is square root of x squared, that means that all negative values cancel out”, says Simon, that’s why the wave looks spiky.
Simon’s tool should probably be improved by making it from thicker material like thick cardboard.
Simon partially programmed the interactive math functions editor, but it remained unfinished:
Simon playing around with sine, cosine and radii in Grapher:
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:
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:
Simon talks about his changes to Daniel Shiffman’s Spherical Geometry Coding Challenge: He has rewritten the code in an object oriented manner. Later he also turned the sphere into an ellipsoid using three radii.
Object oriented (Simon’s idea):
Adding colour (Daniel’s feature):
Turning the sphere into ellipsoid (Simon’s idea):
Simon would also like to try this with a cylinder:
Simon wanted to share his code in a readme in GitHub but he didn’t manage to create one within the specific (Sphere Geometry) project. Here is a screenshot of him sharing the code in Slack chat (for Coding Train fans):
Heard Simon give his Russian grandparents a lecture in the playroom, via FaceTime. When I came in, this is what I saw on the whiteboard. Simon proudly said he figured out how to calculate the arc-tangent. Why, what do you talk to your Grandmom about?
Simon translated Daniel Shiffman’s Graphing 1D Perlin Noise tutorial into Processing (Java). The project involved combining perlin noise and sine wave:
He also attempted to translate Perlin Noise Flow Field into Processing:
Simon built a Polar to Cartesian converter (Simon’s own code). You can enter the radius in pixels and the angle in degrees, click “convert” and you get the coordinates in x and y and a circle appears n that spot.
You are welcome to play with Simon’s converter online in CodePen at: https://codepen.io/simontiger/pen/MmdodP
Simon is also planning to make a similar converter for Spherical to Cartesian (where you would enter radius, latitude and longitude and convert those into x,y,z).
Here Simon explains the formulas to convert between Polar and Cartesian coordinates:
Simon’s big project the last couple of days was about making a steering behaviors database, complete with a navigation menu (in Cloud9):
He managed to finish the first two examples – “Seek and Flee” and “Pursuit and Evasion” – and worked on the Flow Field Following and Path Following.
As recommended by Daniel Shiffman, Simon largely relied on the paper called Steering Behaviors For Autonomous Characters (written by Craig W. Reynolds from Sony). As Simon told me, he tried to guess the code to make the static drawings in the paper come to life. For instance, for the “Seek and Flee” example, Simon animated this drawing:
Simon also made a “Seek” example in the language called Lua (from the Codea app):
The second example was about Pursuit and Evasion:
Simon also explained to me how Flow Field Following worked:
Another steering behavior he scrutinized was Path Following. For Path Following, he first had to learn what the “dot product” was. In math, the dot product or scalar product is an algebraic operation that takes two equal-length sequences of numbers (usually coordinate vectors) and returns a single number.
The way Simon learns is usually by studying (deconstructing) and memorizing the formulas (even if he doesn’t fully understand them in the beginning). After he comes back to the formula later on he seems to have grasped the meaning of it. I often observe him actually apply different formulas in real life. When it comes to the “dot product”, Simon is in the beginning of the learning curve:
The formula for scalar projection is:
or the way Simon put it: