/* (non-Javadoc)
@see org.joml.Vector4dc#rotate(org.joml.Quaterniondc, org.joml.Vector4d)
977923
public Vector4d rotate(Quaterniondc quat, Vector4d dest) {
        quat.transform(this, dest);
        return dest;
    }
366385
public Matrix4f rotateAroundLocal(Quaternionfc quat, float ox, float oy, float oz, Matrix4f dest) {
        float w2 = quat.w() * quat.w();
        float x2 = quat.x() * quat.x();
        float y2 = quat.y() * quat.y();
        float z2 = quat.z() * quat.z();
        float zw = quat.z() * quat.w();
        float xy = quat.x() * quat.y();
        float xz = quat.x() * quat.z();
        float yw = quat.y() * quat.w();
        float yz = quat.y() * quat.z();
        float xw = quat.x() * quat.w();
        float lm00 = w2 + x2 - z2 - y2;
        float lm01 = xy + zw + zw + xy;
        float lm02 = xz - yw + xz - yw;
        float lm10 = -zw + xy - zw + xy;
        float lm11 = y2 - z2 + w2 - x2;
        float lm12 = yz + yz + xw + xw;
        float lm20 = yw + xz + xz + yw;
        float lm21 = yz + yz - xw - xw;
        float lm22 = z2 - y2 - x2 + w2;
        float tm00 = m00 - ox * m03;
        float tm01 = m01 - oy * m03;
        float tm02 = m02 - oz * m03;
        float tm10 = m10 - ox * m13;
        float tm11 = m11 - oy * m13;
        float tm12 = m12 - oz * m13;
        float tm20 = m20 - ox * m23;
        float tm21 = m21 - oy * m23;
        float tm22 = m22 - oz * m23;
        float tm30 = m30 - ox * m33;
        float tm31 = m31 - oy * m33;
        float tm32 = m32 - oz * m33;
        dest._m00(lm00 * tm00 + lm10 * tm01 + lm20 * tm02 + ox * m03);
        dest._m01(lm01 * tm00 + lm11 * tm01 + lm21 * tm02 + oy * m03);
        dest._m02(lm02 * tm00 + lm12 * tm01 + lm22 * tm02 + oz * m03);
        dest._m03(m03);
        dest._m10(lm00 * tm10 + lm10 * tm11 + lm20 * tm12 + ox * m13);
        dest._m11(lm01 * tm10 + lm11 * tm11 + lm21 * tm12 + oy * m13);
        dest._m12(lm02 * tm10 + lm12 * tm11 + lm22 * tm12 + oz * m13);
        dest._m13(m13);
        dest._m20(lm00 * tm20 + lm10 * tm21 + lm20 * tm22 + ox * m23);
        dest._m21(lm01 * tm20 + lm11 * tm21 + lm21 * tm22 + oy * m23);
        dest._m22(lm02 * tm20 + lm12 * tm21 + lm22 * tm22 + oz * m23);
        dest._m23(m23);
        dest._m30(lm00 * tm30 + lm10 * tm31 + lm20 * tm32 + ox * m33);
        dest._m31(lm01 * tm30 + lm11 * tm31 + lm21 * tm32 + oy * m33);
        dest._m32(lm02 * tm30 + lm12 * tm31 + lm22 * tm32 + oz * m33);
        dest._m33(m33);
        dest._properties(properties & ~(PROPERTY_PERSPECTIVE | PROPERTY_IDENTITY | PROPERTY_TRANSLATION));
        return dest;
    }
320627
public void rotate(double x, double y) {
        if (!(projection instanceof Projection3D)) {
            throw new UnsupportedOperationException("Only 3D graphics supports rotation.");
        }

        ((Projection3D) projection).rotate(x, y);
    }
838670
public Quaternionf rotateLocalX(float angle, Quaternionf dest) {
        float hangle = angle * 0.5f;
        float s = (float) Math.sin(hangle);
        float c = (float) Math.cosFromSin(s, hangle);
        dest.set(c * x + s * w,
                 c * y - s * z,
                 c * z + s * y,
                 c * w - s * x);
        return dest;
    }
1205124
public Vector4d rotateX(double angle, Vector4d dest) {
        double sin = Math.sin(angle), cos = Math.cosFromSin(sin, angle);
        double y = this.y * cos - this.z * sin;
        double z = this.y * sin + this.z * cos;
        dest.x = this.x;
        dest.y = y;
        dest.z = z;
        dest.w = this.w;
        return dest;
    }
85793
public Quaternionf set(Quaternionfc q) {
        if (q instanceof Quaternionf)
            MemUtil.INSTANCE.copy((Quaternionf) q, this);
        else {
            this.x = q.x();
            this.y = q.y();
            this.z = q.z();
            this.w = q.w();
        }
        return this;
    }
719900
public static Geometry rotate(Geometry geom, double theta, Point point) {
        return rotate(geom, theta, point.getX(), point.getY());
    }
233021
public void setRotation(String rotation) {
        if (rotation != null) {
            try {
                setRotation(Integer.parseInt(rotation));
            } catch (NumberFormatException e) {
                setRotation(-1);
            }
        }
    }
725247
public Matrix4d rotateAroundLocal(Quaterniondc quat, double ox, double oy, double oz, Matrix4d dest) {
        double w2 = quat.w() * quat.w();
        double x2 = quat.x() * quat.x();
        double y2 = quat.y() * quat.y();
        double z2 = quat.z() * quat.z();
        double zw = quat.z() * quat.w();
        double xy = quat.x() * quat.y();
        double xz = quat.x() * quat.z();
        double yw = quat.y() * quat.w();
        double yz = quat.y() * quat.z();
        double xw = quat.x() * quat.w();
        double lm00 = w2 + x2 - z2 - y2;
        double lm01 = xy + zw + zw + xy;
        double lm02 = xz - yw + xz - yw;
        double lm10 = -zw + xy - zw + xy;
        double lm11 = y2 - z2 + w2 - x2;
        double lm12 = yz + yz + xw + xw;
        double lm20 = yw + xz + xz + yw;
        double lm21 = yz + yz - xw - xw;
        double lm22 = z2 - y2 - x2 + w2;
        double tm00 = m00 - ox * m03;
        double tm01 = m01 - oy * m03;
        double tm02 = m02 - oz * m03;
        double tm10 = m10 - ox * m13;
        double tm11 = m11 - oy * m13;
        double tm12 = m12 - oz * m13;
        double tm20 = m20 - ox * m23;
        double tm21 = m21 - oy * m23;
        double tm22 = m22 - oz * m23;
        double tm30 = m30 - ox * m33;
        double tm31 = m31 - oy * m33;
        double tm32 = m32 - oz * m33;
        dest.m00 = lm00 * tm00 + lm10 * tm01 + lm20 * tm02 + ox * m03;
        dest.m01 = lm01 * tm00 + lm11 * tm01 + lm21 * tm02 + oy * m03;
        dest.m02 = lm02 * tm00 + lm12 * tm01 + lm22 * tm02 + oz * m03;
        dest.m03 = m03;
        dest.m10 = lm00 * tm10 + lm10 * tm11 + lm20 * tm12 + ox * m13;
        dest.m11 = lm01 * tm10 + lm11 * tm11 + lm21 * tm12 + oy * m13;
        dest.m12 = lm02 * tm10 + lm12 * tm11 + lm22 * tm12 + oz * m13;
        dest.m13 = m13;
        dest.m20 = lm00 * tm20 + lm10 * tm21 + lm20 * tm22 + ox * m23;
        dest.m21 = lm01 * tm20 + lm11 * tm21 + lm21 * tm22 + oy * m23;
        dest.m22 = lm02 * tm20 + lm12 * tm21 + lm22 * tm22 + oz * m23;
        dest.m23 = m23;
        dest.m30 = lm00 * tm30 + lm10 * tm31 + lm20 * tm32 + ox * m33;
        dest.m31 = lm01 * tm30 + lm11 * tm31 + lm21 * tm32 + oy * m33;
        dest.m32 = lm02 * tm30 + lm12 * tm31 + lm22 * tm32 + oz * m33;
        dest.m33 = m33;
        dest.properties = properties & ~(PROPERTY_PERSPECTIVE | PROPERTY_IDENTITY | PROPERTY_TRANSLATION);
        return dest;
    }
1171659
@NonNull
  public RequestCreator rotate(float degrees, float pivotX, float pivotY) {
    data.rotate(degrees, pivotX, pivotY);
    return this;
  }
258017
public Quaterniond rotateZYX(double angleZ, double angleY, double angleX, Quaterniond dest) {
        double sx =  Math.sin(angleX * 0.5);
        double cx =  Math.cosFromSin(sx, angleX * 0.5);
        double sy =  Math.sin(angleY * 0.5);
        double cy =  Math.cosFromSin(sy, angleY * 0.5);
        double sz =  Math.sin(angleZ * 0.5);
        double cz =  Math.cosFromSin(sz, angleZ * 0.5);

        double cycz = cy * cz;
        double sysz = sy * sz;
        double sycz = sy * cz;
        double cysz = cy * sz;
        double w = cx*cycz + sx*sysz;
        double x = sx*cycz - cx*sysz;
        double y = cx*sycz + sx*cysz;
        double z = cx*cysz - sx*sycz;
        // right-multiply
        dest.set(this.w * x + this.x * w + this.y * z - this.z * y,
                 this.w * y - this.x * z + this.y * w + this.z * x,
                 this.w * z + this.x * y - this.y * x + this.z * w,
                 this.w * w - this.x * x - this.y * y - this.z * z);
        return dest;
    }
1341267
def rotate(self, vec):
    

    qvec = self * Quaternion(vec.x, vec.y, vec.z, 0) * ~self
    return type(vec)(qvec.x, qvec.y, qvec.z)
282863
public static void rotateCCW( GrayS64 input , GrayS64 output ) {
		if( input.width != output.height || input.height != output.width )
			throw new IllegalArgumentException("Incompatible shapes");

		int w = input.width-1;

		for( int y = 0; y < input.height; y++ ) {
			int indexIn = input.startIndex + y*input.stride;
			for (int x = 0; x < input.width; x++) {
				output.unsafe_set(y,w-x,input.data[indexIn++]);
			}
		}
	}
158819
public void setValue(Quaternionf rot) {
        mX = rot.x;
        mY = rot.y;
        mZ = rot.z;
        mW = rot.w;
    }
631230
public Quaterniond rotateAxis(double angle, Vector3dc axis, Quaterniond dest) {
        return rotateAxis(angle, axis.x(), axis.y(), axis.z(), dest);
    }
652902
@Override
	public String getDefaultOrientation() {
		StringBuilder s = new StringBuilder();
		s.append(setCentroid());

		// calculate  orientation
		Quat4d q = new Quat4d();
		q.set(polyhedron.getViewMatrix(0));
		q.normalize();
		Quat4d r = new Quat4d();
		r.set(rotationAxisAligner.getRotationMatrix());
		r.normalize();
		q.mul(r);
		q.normalize();

		// set orientation
		s.append("moveto 0 quaternion{");
		s.append(jMolFloat(q.x));
		s.append(",");
		s.append(jMolFloat(q.y));
		s.append(",");
		s.append(jMolFloat(q.z));
		s.append(",");
		s.append(jMolFloat(q.w));
		s.append("};");
		return s.toString();
	}
711828
public void rotate() {
    Map<Long, Long> m = buckets.removeLast();
    buckets.addFirst(new HashMap<Long, Long>());
  }