And it turned out to be a that little path next to the Royal Observatory in Greenwich, not the Prime Meridian line. The 0° meridian is what the GPS uses for global navigation, the discrepancy results from the fact that the Prime Meridian was originally measured without taking it into consideration that the Earth isn’t a perfect smooth ball (if the measurements are made inside the UK, as it it was originally done, this does’t lead to as much discrepancy as when vaster areas are included).
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):
Simon came up with an idea to translate a physics visualization from the Codea app (using a language called Lua) into Processing (Java) by applying Box2D. The first two videos below show him working on that project.
As he got stuck later, Simon decided to do the same project in p5.js instead, applying Matter.js:
This turned out to be quite difficult as well: he got stuck while trying to calculate the exact coordinates for all the shapes involved in the visualization (it was supposed to resemble bricks falling down and rolling down two slopes). So what Simon did as the next step in this “exercise” was switch back to Processing and create a grid with numbered coordinates. When I asked him, why he didn’t make the same grid in p5, he answered that he just loved Processing so much. Eventually though, this grew into a different project:
Confusing as these sidesteps may seem I’m sure Simon got a lot of practice out of this.
Here is a game Simon tried translating from Lua into Processing, it’s called Brickout:
On Friday Simon finished another beautiful Daniel Shiffman coding challenge called Mapping Earthquake Data. The purpose of this coding challenge was to visualize earthquake data from the USGS website (http://earthquake.usgs.gov/data/) by mapping the latitude, longitude and the magnitude of earthquakes with p5.js. The map imagery is pulled from mapbox.js and the math demonstrated coverts latitude, longitude to x,y via Web Mercator (the de facto standard for web mapping applications).
In Web Mercator, the “world coordinates” are adjusted such that the upper left corner is (0, 0) and the lower right corner is (256, 256). To visualize a place on the map, its coordinates are calculated with the help of this crazy formula:
where λ is the longitude in radians and φ is latitude in radians.
Daniel Shiffman turned parts of the formula into a, b and c to make it easier to apply it within the code. The coordinates he got as the result should then be subtracted from the center of the screen. Simon first forgot to do that subtraction bit and his Shanghai ended up outside the screen, which caused a lot of tears. The next day, after a long search, he found the problem.
And his math tutor explained what logarithms are.