protected double getAngleFromVelocity() {
        double angle = 0.0f;
        float slope = 0.0f;
        if(velocityX == 0.0f) {
            if(velocityX > 0.0f) {
                angle = Math.PI / 2;
            } else {
                angle = -Math.PI / 2;
            }
        } else {
            slope = -velocityY / velocityX;
            angle = Math.atan(slope);
            if (velocityX < 0) {
                angle += Math.PI;
            }
        }
        return angle;
    }