Use Pythagoras outside of the paper to calculate the distance between 2 points on a map.
As part of our training course, we get our developers to interact with an API to pull down data from the cloud about the weather in each city in the UK. As part of that task, we also want them to calculate the closest cities to their location.
Pythagoras makes it incredibly easy to do this given 2 sets of longitude and latitude values.
Say you want to calculate the distance from Stourbridge (a, b) (52.4590211,-2.148321) to London (51.5281798,-0.4312217) (x, y), we can simply use:
√(|a - b|2 + |x - y|2) = distance to the city