@Override
    public Point getNextLocation(int ix, int iy, int fx, int fy) {
        double theta = orbit.getTheta(ix, iy);
        double dTheta = orbit.getTheta(fx, fy) - theta;

        if (Math.abs(dTheta) > Math.PI) {
            dTheta = (Math.PI*2 - Math.abs(dTheta))* ProjUtils.getSign(dTheta)*(-1);
        }

        if (rotationPref == ROTATION_PREF_CW && dTheta < 0) {
            dTheta += Math.PI*2;
        }
        else if (rotationPref == ROTATION_PREF_CCW && dTheta > 0) {
            dTheta -= Math.PI*2;
        }

        if (!(Math.abs(dTheta) <= Math.PI*2/360)) {
            dTheta = Math.max(Math.abs(dTheta*MAGIC_RATE_CONSTANT), Math.PI*2/360/2)* ProjUtils.getSign(dTheta);
        }

        if (dTheta == 0) {
            return null;
        }

        return new Point(orbit.getRoundX(theta + dTheta), orbit.getRoundY(theta + dTheta));
    }