Hello all, I have a problem, my algorithm works fine on the two first tests, but doesn't work on third and forth. It finds another solution than the one in out.txt, but when I take a look at the distance, the solution I find is still lower. I find CRR instead of the one in out.txt. Here is how I compute the distance
var x = (LON - lon) * Math.cos((LAT + lat)/2);
var y = (LAT - lat);
var d = Math.pow(x,2) + Math.pow(y,2);
lon and lat are the longitude and latitude of the current defribillators.
Any ideas ?
EDIT : I've found, actually it was just a problem of replace, replace() had just replace the first comma and not all of them.