Replies the rotation angle represented by this quaternion.

@return the rotation axis
@see #setAxisAngle(Vector3D, double)
@see #setAxisAngle(double, double, double, double)
@see #getAxis()
488489
@Pure
	public final double getAngle() {
		double mag = this.x*this.x + this.y*this.y + this.z*this.z;  

		if ( mag > EPS ) {
			mag = Math.sqrt(mag);
			return (2.f*Math.atan2(mag, this.w)); 
		}
		return 0f;
	}
953793
public void rotate(Vector3D axis, double angle) {
		Quaternion q = new Quaternion();
		q.setAxisAngle(axis, angle);
		rotate(q, null);
	}
1261137
public Angle turn(Angle angle)
    {
        if (angle.getRadians() < Math.PI)
        {
            return add(angle, true);
        }
        else
        {
            return add(angle.toHalfAngle(), false);
        }
    }
872753
protected double getMaxExtension() {
		Vector3d dimension = rotationAxisAligner.getDimension();
		double maxExtension = Math.max(dimension.x, dimension.y);
		maxExtension = Math.max(maxExtension, dimension.z);
		return maxExtension;
	}
1224528
public Quaternion fromAngleAxis (float angle, IVector3 axis) {
        return fromAngleAxis(angle, axis.x(), axis.y(), axis.z());
    }
68797
public Quaternion fromAnglesXY (float x, float y) {
        float hx = x * 0.5f, hy = y * 0.5f;
        float sx = FloatMath.sin(hx), cx = FloatMath.cos(hx);
        float sy = FloatMath.sin(hy), cy = FloatMath.cos(hy);
        return set(cy*sx, sy*cx, -sy*sx, cy*cx);
    }
374239
private Vector3d getReferenceAxisCylicWithSubunitAlignment() {
		if (rotationGroup.getPointGroup().equals("C2")) {
			return referenceVector;
		}

		// find subunit that extends the most in the xy-plane
		List<List<Integer>> orbits = getOrbitsByXYWidth();
		// get the last orbit which is the widest
		List<Integer> widestOrbit = orbits.get(orbits.size()-1);
		List<Point3d> centers = subunits.getCenters();
		int subunit = widestOrbit.get(0);

		// calculate reference vector
		Vector3d refAxis = new Vector3d();
		refAxis.sub(centers.get(subunit), subunits.getCentroid());
		refAxis.normalize();
		return refAxis;
	}
108262
public Box rotate3D() {
		int height = this.height;

		this.height = width;
		this.width = depth;
		this.depth = height;

		return this;
	}
1333322
public Quaterniond fromAxisAngleRad(Vector3dc axis, double angle) {
        return fromAxisAngleRad(axis.x(), axis.y(), axis.z(), angle);
    }
262640
public Matrix4f set(AxisAngle4d axisAngle) {
        double x = axisAngle.x;
        double y = axisAngle.y;
        double z = axisAngle.z;
        double angle = axisAngle.angle;
        double n = Math.sqrt(x*x + y*y + z*z);
        n = 1/n;
        x *= n;
        y *= n;
        z *= n;
        double s = Math.sin(angle);
        double c = Math.cosFromSin(s, angle);
        double omc = 1.0 - c;
        this._m00((float)(c + x*x*omc));
        this._m11((float)(c + y*y*omc));
        this._m22((float)(c + z*z*omc));
        double tmp1 = x*y*omc;
        double tmp2 = z*s;
        this._m10((float)(tmp1 - tmp2));
        this._m01((float)(tmp1 + tmp2));
        tmp1 = x*z*omc;
        tmp2 = y*s;
        this._m20((float)(tmp1 + tmp2));
        this._m02((float)(tmp1 - tmp2));
        tmp1 = y*z*omc;
        tmp2 = x*s;
        this._m21((float)(tmp1 - tmp2));
        this._m12((float)(tmp1 + tmp2));
        this._m03(0.0f);
        this._m13(0.0f);
        this._m23(0.0f);
        this._m30(0.0f);
        this._m31(0.0f);
        this._m32(0.0f);
        this._m33(1.0f);
        this._properties(PROPERTY_AFFINE | PROPERTY_ORTHONORMAL);
        return this;
    }
921781
public Surface rotate (float angle) {
    float sr = (float) Math.sin(angle);
    float cr = (float) Math.cos(angle);
    transform(cr, sr, -sr, cr, 0, 0);
    return this;
  }
705869
def get_axis_angle(self):
        
        # Init
        angle = 2 * np.arccos(max(min(self.w, 1.), -1.))
        scale = (self.x**2 + self.y**2 + self.z**2)**0.5    
        
        # Calc axis
        if scale:
            ax = self.x / scale
            ay = self.y / scale
            az = self.z / scale
        else:
            # No rotation, so arbitrary axis
            ax, ay, az = 1, 0, 0
        # Return
        return angle, ax, ay, az
873269
protected BufferedImage rotate(double angle) {
        BufferedImage target = new BufferedImage(height, width, awt.getType());
        Graphics2D g2 = (Graphics2D) target.getGraphics();
        final int offsetx, offsety;
        if (angle < 0) {
            offsetx = 0;
            offsety = width;
        } else if (angle > 0) {
            offsetx = height;
            offsety = 0;
        } else {
            offsetx = 0;
            offsety = 0;
        }
        g2.translate(offsetx, offsety);
        g2.rotate(angle);
        g2.drawImage(awt, 0, 0, null);
        g2.dispose();
        return target;
    }
1151046
@Pure
	public DoubleProperty yProperty() {
		if (this.y == null) {
			this.y = new SimpleDoubleProperty(this, MathFXAttributeNames.Y);
		}
		return this.y;
	}
407262
@Pure
	@SuppressWarnings("checkstyle:magicnumber")
	public double getRotation() {
		final double[] tmpScale = new double[3];
		final double[] tmpRot = new double[9];
		getScaleRotate2x2(tmpScale, tmpRot);
		if (Math.signum(tmpRot[0]) != Math.signum(tmpRot[4])) {
			// Sinuses are on the top-left to bottom-right diagonal
			// -s   c   0
			//  c   s   0
			//  0   0   1
			return Math.atan2(tmpRot[4], tmpRot[3]);
		}
		// Sinuses are on the top-right to bottom-left diagonal
		//  c  -s  0
		//  s   c  0
		//  0   0  1
		return Math.atan2(tmpRot[3], tmpRot[0]);
	}
157407
public Quaternion fromAngles (float x, float y, float z) {
        // TODO: it may be more convenient to define the angles in the opposite order (first z,
        // then y, then x)
        float hx = x * 0.5f, hy = y * 0.5f, hz = z * 0.5f;
        float sz = FloatMath.sin(hz), cz = FloatMath.cos(hz);
        float sy = FloatMath.sin(hy), cy = FloatMath.cos(hy);
        float sx = FloatMath.sin(hx), cx = FloatMath.cos(hx);
        float szsy = sz*sy, czsy = cz*sy, szcy = sz*cy, czcy = cz*cy;
        return set(
            czcy*sx - szsy*cx,
            czsy*cx + szcy*sx,
            szcy*cx - czsy*sx,
            czcy*cx + szsy*sx);
    }
1110701
public float getRotation() {
    if (mDetector.getPointerCount() < 2) {
      return 0;
    } else {
      float startDeltaX = mDetector.getStartX()[1] - mDetector.getStartX()[0];
      float startDeltaY = mDetector.getStartY()[1] - mDetector.getStartY()[0];
      float currentDeltaX = mDetector.getCurrentX()[1] - mDetector.getCurrentX()[0];
      float currentDeltaY = mDetector.getCurrentY()[1] - mDetector.getCurrentY()[0];
      float startAngle = (float) Math.atan2(startDeltaY, startDeltaX);
      float currentAngle = (float) Math.atan2(currentDeltaY, currentDeltaX);
      return currentAngle - startAngle;
    }
  }