code: public double[] getRollPitchYaw() {
  		double[] ret = new double[3];
  		
  		// roll (x-axis rotation)
  		double sinr = +2.0 * (w * x + y * z);
  		double cosr = +1.0 - 2.0 * (x * x + y * y);
  		ret[0] = Math.atan2(sinr, cosr);
  
  		// pitch (y-axis rotation)
  		double sinp = +2.0 * (w * y - z * x);
  		// use 90 degrees if out of range
  		if (Math.abs(sinp) >= 1) ret[1] = Math.copySign(Math.PI / 2.0, sinp);
  		else ret[1] = Math.asin(sinp);
  
  		// yaw (z-axis rotation)
  		double siny = +2.0 * (w * z + x * y);
  		double cosy = +1.0 - 2.0 * (y * y + z * z);  
  		ret[2] = Math.atan2(siny, cosy);
  		
  		return ret;
  	}
docs: Get the roll, pitch and yaw angles in radians represented by this {@link Quaternion}.
  @return The roll, pitch and yaw angles (in that order) in radians represented by this {@link Quaternion}.