I tried to calculate the angle between my start position and end position, but it keeps a number between 2 and -2. I got this code from stack overflow (http://stackoverflow.com/questions/2676719/calculating-the-angle-between-the-line-defined-by-two-points) and intergrated it in my GridClass. Does anyone know what's wrong with this code?
public static double getAngle(GeoPosition startPosition, GeoPosition endPosition)
{
double a_x = endPosition.getLatitude() - startPosition.getLatitude();
double a_y = endPosition.getLongitude() - startPosition.getLongitude();
return Math.atan2(a_y, a_x);
}