Calculating how far away a storm 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 perform the calculation is to count the seconds that pass from when the light occurs (the lightning), until the thunder is heard. This time difference is because light travels at a speed of 300,000km per second and sound, in the air, at only 340m per second. Therefore, to calculate the distance to a storm, we apply the following formula:
Distance = seconds elapsed (from when 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 pass and perform the calculation again. If in this second calculation the result is smaller than the previous one, it means the storm is coming towards us. If the second result is larger, the storm is moving away.
There is a good preventive 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 pass between the lightning and the thunder, and only going outdoors when 30 minutes have passed since the last thunder.