I use PostGIS with PostgreSQL to calculate the distance between two places, specified by a latitude and longitude coordinate. The outcome of 18.5 km is what I expect:
SELECT ST_DISTANCE(epicenter, house_location)/1000 "distance_in_km" FROM ( SELECT ST_SetSRID(ST_Point(53.345, 6.672),4326)::geography(point,4326) epicenter , ST_SetSRID(ST_Point(53.2081669, 6.5759146),4326)::geography(point,4326) house_location ) x;
What I want to know is the distance between those two points, without considering the curve of the earth.
My use case: I have a location of an earthquake (epicentre) and a location of a house. I also know the depth of the earthquake, and with Pythagoras I calculate the distance between the house and the hypocenter.
These calculations are Euclidean, but the distance calculation is not. I've heard the difference is minimal, but I want to know for myself what the difference is, how I can calculate it?
I assume both places have the same distance to the earth's center (but if you know how to take that fact into the equation, I would be interested as well).