It's even better to compute the right radius with the code provided above (EarthRadiusInMeters).under the latitudes of France or Belgium (~45°), it is usual to take 6371000 for the radius of the earth instead of 6378, which is the radius of the earth at the equator. (https://fr.wikipedia.org/wiki/Rayon_de_la_Terre)