/* (non-Javadoc)
@see org.joml.Quaternionfc#get(org.joml.AxisAngle4f)
19257
public AxisAngle4f get(AxisAngle4f dest) {
        float x = this.x;
        float y = this.y;
        float z = this.z;
        float w = this.w;
        if (w > 1.0f) {
            float invNorm = (float) (1.0 / Math.sqrt(x * x + y * y + z * z + w * w));
            x *= invNorm;
            y *= invNorm;
            z *= invNorm;
            w *= invNorm;
        }
        dest.angle = (float) (2.0f * Math.acos(w));
        float s = (float) Math.sqrt(1.0 - w * w);
        if (s < 0.001f) {
            dest.x = x;
            dest.y = y;
            dest.z = z;
        } else {
            s = 1.0f / s;
            dest.x = x * s;
            dest.y = y * s;
            dest.z = z * s;
        }
        return dest;
    }
117196
def from_axis_angle(axis, angle):
    

    sincomp = math.sin(angle / 2.0)
    return Quaternion(
      axis.x * sincomp, axis.y * sincomp,
      axis.z * sincomp, math.cos(angle / 2.0))
1197132
@Override
  public V get(Object key) {
    // key could be not in original or in deltaMap
    // key could be not in original but in deltaMap
    // key could be in original but removed from deltaMap
    // key could be in original but mapped to something else in deltaMap
    V deltaResult = deltaMap.get(key);
    if (deltaResult == null) {
      return originalMap.get(key);
    }
    if (deltaResult == nullValue) {
      return null;
    }
    if (deltaResult == removedValue) {
      return null;
    }
    return deltaResult;
  }
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;
	}
631230
public Quaterniond rotateAxis(double angle, Vector3dc axis, Quaterniond dest) {
        return rotateAxis(angle, axis.x(), axis.y(), axis.z(), dest);
    }
1175767
public Quaternionf rotateAxis(float angle, Vector3fc axis, Quaternionf dest) {
        return rotateAxis(angle, axis.x(), axis.y(), axis.z(), dest);
    }
706330
public AxisAngle4f rotate(float ang) {
        angle += ang;
        angle = (float) ((angle < 0.0 ? Math.PI + Math.PI + angle % (Math.PI + Math.PI) : angle) % (Math.PI + Math.PI));
        return this;
    }
256120
public Quaternionf fromAxisAngleRad(Vector3fc axis, float angle) {
        return fromAxisAngleRad(axis.x(), axis.y(), axis.z(), angle);
    }
128713
public Matrix4f getMatrix() {
        if (updateMatrix) {
            final Matrix4f matrix = Matrix4f.createScaling(scale.toVector4(1)).rotate(rotation).translate(position);
            if (parent == null) {
                this.matrix = matrix;
            } else {
                childMatrix = matrix;
            }
            updateMatrix = false;
        }
        if (parent != null) {
            final Matrix4f parentMatrix = parent.getMatrix();
            if (parentMatrix != lastParentMatrix) {
                matrix = parentMatrix.mul(childMatrix);
                lastParentMatrix = parentMatrix;
            }
        }
        return matrix;
    }
924865
public static double getAngle(Matrix4d transform) {
		// Calculate angle
		double c = (transform.m00 + transform.m11 + transform.m22 - 1)/2.0; //=cos(theta)
		// c is sometimes slightly out of the [-1,1] range due to numerical instabilities
		if( -1-1e-8 < c && c < -1 ) c = -1;
		if( 1+1e-8 > c && c > 1 ) c = 1;
		if( -1 > c || c > 1 ) {
			throw new IllegalArgumentException("Input matrix is not a valid rotation matrix.");
		}
		return Math.acos(c);
	}
998272
public Matrix3d set(AxisAngle4f axisAngle) {
        double x = axisAngle.x;
        double y = axisAngle.y;
        double z = axisAngle.z;
        double angle = axisAngle.angle;
        double invLength = 1.0 / Math.sqrt(x*x + y*y + z*z);
        x *= invLength;
        y *= invLength;
        z *= invLength;
        double s = Math.sin(angle);
        double c = Math.cosFromSin(s, angle);
        double omc = 1.0 - c;
        m00 = c + x*x*omc;
        m11 = c + y*y*omc;
        m22 = c + z*z*omc;
        double tmp1 = x*y*omc;
        double tmp2 = z*s;
        m10 = tmp1 - tmp2;
        m01 = tmp1 + tmp2;
        tmp1 = x*z*omc;
        tmp2 = y*s;
        m20 = tmp1 + tmp2;
        m02 = tmp1 - tmp2;
        tmp1 = y*z*omc;
        tmp2 = x*s;
        m21 = tmp1 - tmp2;
        m12 = tmp1 + tmp2;
        return this;
    }
202575
public Matrix4d translation(Vector3dc offset) {
        return translation(offset.x(), offset.y(), offset.z());
    }
1257597
private static AxisAngle4d getAxisAngle(Matrix4d transformation) {
		AxisAngle4d axis = new AxisAngle4d();
		axis.set(transformation);
		return axis;
	}
700606
private Vector3d getNonColinearVector(Vector3d ab) {
        Vector3d cr = new Vector3d();
        cr.cross(ab, XV);
        if (cr.length() > 0.00001) {
            return XV;
        } else {
            return YV;
        }
    }
1145371
public AxisAngle4d set(double angle, Vector3dc v) {
        return set(angle, v.x(), v.y(), v.z());
    }
931882
@Pure
	public final Vector3f getAxis() {
		double mag = this.x*this.x + this.y*this.y + this.z*this.z;  

		if ( mag > EPS ) {
			mag = Math.sqrt(mag);
			double invMag = 1f/mag;

			return new Vector3f(
					this.x*invMag,
					this.y*invMag,
					this.z*invMag);
		}
		return new Vector3f(0f, 0f, 1f);
	}
541906
public AxisAngle4d set(double angle, Vector3f v) {
        return set(angle, v.x, v.y, v.z);
    }