PHP Geographicals Coriolis Effect Revisit Tutorial

PHP Geographicals Coriolis Effect Revisit Tutorial

PHP Geographicals Coriolis Effect Revisit Tutorial

Today we’re revisiting our inhouse Coriolis Effect calculator, further to work at PHP Geographicals Makeover Primer Tutorial, for a couple of reasons …

  1. we wanted to not show iframe that used to house the weather information any more when that information comes, these days, from a Google search engine query popup window … and …
  2. where it used to give a result such as …

    Earth Coriolis Force for Latitude,Longitude below represents a 6.84e-5 ms-2 deflection from → West to → East for each ms-1 of Southerly ↑ wind

    … it used to be possible for the dropdowns below that to not reflect the Latitude,Longitude entered in by the user via the clicking of links mentioning “Coriolis” … very annoying …

… and, yet again, we found it useful to use …

  • new HTML iframe …

    <iframe id="weather" frameborder=0 onerror=nochkit(this); onload=chkit(this); style="background-color: lightgray; display: BLOCK; height: 460px; width: 500px;" src="javascript: false;"></iframe>

    onload event logic … as well as …
  • new HTML iframe onerror event logic … Javascript …

    function nochkit(iois) {
    setTimeout(function(){ parent.document.getElementById('weather').style.display='none'; }, 1000);
    setTimeout(function(){ if (!onealert) { setInterval(sichkit, 1000); onealert=true; parent.document.getElementById('weather').style.display='none'; if (document.URL.indexOf('rjmprogramming.com.au') == -1) { alert('Sorry, the weather interfacing URL was Not Found.'); } } }, 2000);
    }


    function sichkit() {
    if (aconto) {
    if (aconto.body.innerHTML.trim() != '') {
    if (aconto.body.innerHTML.indexOf('>Not Found') != -1) {
    parent.document.getElementById('weather').style.display='none';
    aconto.body.innerHTML='';
    }
    } else {
    parent.document.getElementById('weather').style.display='none';
    aconto.body.innerHTML='';
    }
    }
    }

    function chkit(iois) {
    var allthere=false;
    if (iois != null) { // check out window.svgDocument
    aconto = (iois.contentWindow || iois.contentDocument);
    if (aconto != null) {
    if (aconto.document) {
    aconto = aconto.document;
    if (notyet) { notyet=false; parent.document.getElementById('weather').style.backgroundColor='transparent'; return ''; }
    if (aconto.body.innerHTML.trim() != '') {
    if (aconto.body.innerHTML.indexOf('>Not Found') == -1) {
    iois.style.backgroundColor='lightgray';
    allthere=true;
    parent.document.getElementById('weather').style.display='block';
    } else if (1 == 3) {
    setTimeout(function(){ parent.document.getElementById('weather').style.display='none'; }, 1000);
    setTimeout(function(){ if (!onealert) { setInterval(sichkit, 1000); onealert=true; parent.document.getElementById('weather').style.display='none'; if (document.URL.indexOf('rjmprogramming.com.au') == -1) { alert('Sorry, the weather interfacing URL was Not Found.'); } } }, 2000);
    } else {
    aconto.body.innerHTML='';
    parent.document.title+='4';
    setTimeout(function(){ if (!onealert) { setInterval(sichkit, 1000); onealert=true; parent.document.getElementById('weather').style.display='none'; if (document.URL.indexOf('rjmprogramming.com.au') == -1) { alert('Sorry, the weather interfacing URL was Not Found.'); } } }, 2000);
    nochkit(iois);
    }
    } else {
    setTimeout(function(){ if (!onealert) { setInterval(sichkit, 1000); onealert=true; parent.document.getElementById('weather').style.display='none'; if (document.URL.indexOf('rjmprogramming.com.au') == -1) { alert('Sorry, the weather interfacing URL was Not Found.'); } } }, 2000);
    nochkit(iois);
    }
    }
    }
    } else {
    if (notyet) { notyet=false; parent.document.getElementById('weather').style.backgroundColor='transparent'; return ''; }
    }
    if (!allthere) {
    parent.document.getElementById('weather').style.display='none';
    }
    }

… as contributors to making this happen better with coriolis_force_at.php changed in this way as a Coriolis Effect web application you can also try below …


Previous relevant PHP Geographicals Makeover Primer Tutorial is shown below.

PHP Geographicals Makeover Primer Tutorial

PHP Geographicals Makeover Primer Tutorial

A couple of days ago, when we added PHP Earth Rotational Speed Primer Tutorial as shown below, to our blogroll mix, it got us relooking at our Geographicals Suite of Web Applications at this blog that use this live run interface.

Perhaps you remember the last member of the Geographicals Suite we added, the PHP/Javascript/HTML Coriolis Effect Calculation Tutorial?

We found that, this time around, we wanted to …

  • rework how the weather information is gleaned … we now use a Google Search of a place name + ” weather”
  • get rid of a PHP warning regarding “header has already been sent” … a bug
  • make the interface look a bit better with some CSS for ul->li styling involving emojis a lot like talked about at WordPress Bullet Point CSS Styling Emoji Tutorial and the oft-used CSS H1 CSS Embossed Text Primer Tutorial
  • make the Google Maps “saddr=” and “daddr=” type calls work for mobile platform scenarios

Below is the list of changed parts of the suite …

It is often good to revisit software and see what can be improved with fresh eyes.


Previous relevant PHP Earth Rotational Speed Primer Tutorial is shown below.

PHP Earth Rotational Speed Primer Tutorial

PHP Earth Rotational Speed Primer Tutorial

We discovered a way to calculate the Earth’s rotational speed for a given latitude. When you see how fast we’re moving relative to somebody still in space you’ll be amazed and think gravity is pretty cool. Even if you’re standing on your head right now, you’d have to agree with me that “ytivarg” is not such a bad concept also … “can tell you it saved my bacon back in ’66 when that boar from yonder ridge fell on me when I was stuck practising them thar cartwheely thingos, and got stuck not the right way up … if youse knows what ah mean” … but we digress.

The Earth is like a ball with a rod through it coming out at the North and South poles, and if you can imagine this, then you can probably imagine that the rotational speeds are the biggest near the Equator and get a lot smaller near the Poles.

Still and all, at pretty big latitudes like for Archangel, in Russia, the rotational speeds get up with what we were taught was the speed of a Jumbo jet … back in the day. As for Singapore … wow … take a look at our tutorial picture or try a live run for yourself, and this is our PHP source code you could call rotational_speed_at.php

Ahhhh … the “where” of life … so interesting?!

Believe it or not, the equation to calculate this we found in “New Century Maths 9 (second edition) Stages 5.2/5.3” so thanks. It goes like …


Earth Rotational Speed (in km/h) = ( 2 x Π x 6371 x cos(latitude) ) / 24

… where 6371 will do as radius of Earth in kilometres and 24 is the number of hours in an Earth day and latitude (for most functionalities such as Javascript’s Maths.cos() function) should be expressed in radians (where 1 degree = ( 1 x Π ) / 180 radians), and Π is, well, Π

If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.


If this was interesting you may be interested in this too.

This entry was posted in eLearning, Event-Driven Programming, Tutorials and tagged , , , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *