public static double getAngle(Vector2D vector) {
        double x = vector.x;
        double y = vector.y;
        if (x > 0) {
            return Math.atan(y / x);
        }
        else if (x < 0) {
            return Math.atan(y / x) + Math.PI;
        } else if (y > 0) {
            return -Math.PI / 2;
        } else {
            return Math.PI / 2;
        }
    }