Skip to content
Advertisement

Tag: great-circle

Incorrect output when computing the distance in kilometres of the Great Circle using Haversine formula in Java

I’m trying to compute the distance in kilometres of the Great Circle using Haversine formula in Java as shown below I’m running with input java GreatCircle 60.0 15.0 120.0 105.0. The expected output is 4604.53989281927 kilometers, But I get 13406.238676180266 kilometers. Could someone please point out where am I going wrong? Answer The formula was implemented incorrectly. It worked after

Advertisement