Astronomy, Experiments, Geography, history, Milestones, Notes on everyday life, Physics, Space, Together with sis, Trips

We’ve found the real 0° meridian!

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 standing with one foot in the Western hemisphere and the other one in the Eastern hemisphere
The GPS determines the longitude of the Prime Meridian as 0.0015° W
Simon tried to use JS to program his exact coordinates, but that took a bit too long so we switched to the standard Google Maps instead
The Prime Meridian from inside the Royal Observatory building
Looking for the real 0° meridian: this is an open field next to the Royal Observatory. At this point, the SatNav reads 0.0004° W.
And we finally found the 0° meridian! Some 100 meters to the East of the Prime Meridian
The 0° meridian turned out to intersect the highest point on the path behind Simon’s back!
Simon and Neva running about in between the measurements of longitude
Astronomer Royal Edmond Halley’s scale at the Royal Observatory
Halley’s scale is inscribed by hand
Coding, Java, Murderous Maths, Simon's Own Code

Simon’s changes to Daniel Shiffman’s Spherical Geometry Coding Challenge

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:

DSC_0638

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):

Spherical Geometry sharing in Slack 29 Jun 2017

Coding, Java, JavaScript, Murderous Maths, Physics, Simon's Own Code

Simple Physics. Translating from Lua (the language in the Codea app) into Java

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:

Coding, Geography, Geometry Joys, JavaScript, Milestones, Murderous Maths

Mapping Earthquake Data Coding Challenge

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:

{\begin{aligned}x&={\frac {128}{\pi }}2^{\text{zoom level}}(\lambda +\pi ){\text{ pixels}}\\y&={\frac {128}{\pi }}2^{\text{zoom level}}\left(\pi -\ln \left[\tan \left({\frac {\pi }{4}}+{\frac {\varphi }{2}}\right)\right]\right){\text{ pixels}}\end{aligned}}

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.

 

 

 

Mapping Earthquake Data Coding Challenge 17 Mar 2017 2

Mapping Earthquake Data Coding Challenge 17 Mar 2017