Calculating how far away a thunderstorm is is quite simple and very necessary, as it can help you seek shelter if, by surprise, the sky darkens and the first flashes appear.
The first step to make the calculation is to count the seconds that pass from when the light (the lightning) is produced, until the thunder is heard. This time difference is due to the fact that light travels at a speed of 300,000km per second and sound, in the air, at only 340m per second. Therefore, to calculate how far away a thunderstorm is, we apply the following formula:
Distance = elapsed seconds (from the time you see the lightning until you hear the thunder) / 3
To know if the storm is approaching our position or moving away, we let 2 minutes elapse and do the calculation again, if in this second calculation the result is less than the previous one, it means that the storm is coming towards us. If the second result is higher, the storm is moving away.
There is a good prevention measure, in case of hearing thunder or seeing lightning, which we know as the 30/30 Rule.
This rule consists of seeking shelter if less than 30 seconds elapse between lightning and thunder, and going outdoors only when 30 minutes have elapsed since the last thunderclap.