/* (non-Javadoc)
@see org.joml.Quaterniondc#rotateAxis(double, double, double, double, org.joml.Quaterniond)
494684
public Quaterniond rotateAxis(double angle, double axisX, double axisY, double axisZ, Quaterniond dest) {
        double hangle = angle / 2.0;
        double sinAngle = Math.sin(hangle);
        double invVLength = 1.0 / Math.sqrt(axisX * axisX + axisY * axisY + axisZ * axisZ);

        double rx = axisX * invVLength * sinAngle;
        double ry = axisY * invVLength * sinAngle;
        double rz = axisZ * invVLength * sinAngle;
        double rw = Math.cosFromSin(sinAngle, hangle);

        dest.set(w * rx + x * rw + y * rz - z * ry,
                 w * ry - x * rz + y * rw + z * rx,
                 w * rz + x * ry - y * rx + z * rw,
                 w * rw - x * rx - y * ry - z * rz);
        return dest;
    }
388388
public void setRotation(Quaternionf rotation) {
        setRotation(rotation.w, rotation.x, rotation.y,
                rotation.z);
    }
1342028
public Quaterniond rotateYXZ(double angleY, double angleX, double angleZ, 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 yx = cy * sx;
        double yy = sy * cx;
        double yz = sy * sx;
        double yw = cy * cx;
        double x = yx * cz + yy * sz;
        double y = yy * cz - yx * sz;
        double z = yw * sz - yz * cz;
        double w = yw * cz + yz * sz;
        // 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;
    }
9722
public void setAxis(int axis)
    {
        boolean axisChanged = (axis != majorAxis);
        majorAxis = axis;
        if (axisChanged)
        {
            preferenceChanged(null, true, true);
        }
    }
901502
def qrotate(vector, axis, angle):
    
    n_axis = axis / vnorm(axis)
    sin_angle = np.expand_dims(np.sin(angle / 2), 0)
    if np.ndim(n_axis) == 1:
        n_axis = np.expand_dims(n_axis, 1)
        p__ = np.dot(n_axis, sin_angle)[:, np.newaxis]
    else:
        p__ = n_axis * sin_angle

    q__ = Quaternion(np.cos(angle / 2), p__)
    shape = vector.shape
    return np.einsum("kj, ikj->ij",
                     vector.reshape((3, -1)),
                     q__.rotation_matrix()[:3, :3]).reshape(shape)
1344738
public void rotateCCW(GridInfo grid ) {
		cornerList.clear();
		for (int col = 0; col < grid.cols; col++) {
			for (int row = 0; row < grid.rows; row++) {
				cornerList.add(grid.get(row,grid.cols - col - 1));
			}
		}
		int tmp = grid.rows;
		grid.rows = grid.cols;
		grid.cols = tmp;

		grid.nodes.clear();
		grid.nodes.addAll(cornerList);
	}
864870
public void rotate(Vector3D axis, double angle, Point3D pivot) {
		Quaternion q = new Quaternion();
		q.setAxisAngle(axis, angle);
		rotate(q, pivot);
   	}
27080
function(rot){
        var r = OIMO.EulerToAxis( rot.x * OIMO.TO_RAD, rot.y * OIMO.TO_RAD, rot.z * OIMO.TO_RAD );
        return this.rotationAxisToQuad(r[0], r[1], r[2], r[3]);
    }
11323
public void rotate(Quaternion rotation, Point3D pivot) {
		Point3D currentPivot = getPivot();
    	// Update the plane equation according
    	// to the desired normal (computed from
    	// the identity vector and the rotations).
    	Transform3D m = new Transform3D();
    	m.setRotation(rotation);
    	Vector3f v = new Vector3f(this.getEquationComponentA(),this.getEquationComponentB(),this.getEquationComponentC());
    	m.transform(v);
    	this.setEquationComponentA(v.getX());
    	this.setEquationComponentB(v.getY());
    	this.setEquationComponentC(v.getZ());
    	
    	if (pivot==null) {
	    	// a.x + b.y + c.z + d = 0
	    	// where (x,y,z) is the translation point
	    	this.setEquationComponentD( - (this.getEquationComponentA()*currentPivot.getX() +
	    				this.getEquationComponentB()*currentPivot.getY() +
	    				this.getEquationComponentC()*currentPivot.getZ()));
    	}
    	else {
    		// Compute the new point
    		Point3f nP = new Point3f(
    				currentPivot.getX() - pivot.getX(),
    				currentPivot.getY() - pivot.getY(),
    				currentPivot.getZ() - pivot.getZ());
    		m.transform(nP);
    		nP.setX(nP.getX() + pivot.getX());
    		nP.setY(nP.getY() + pivot.getY());
    		nP.setZ(nP.getZ() + pivot.getZ());
    		
	    	// a.x + b.y + c.z + d = 0
	    	// where (x,y,z) is the translation point
	    	this.setEquationComponentD( - (this.getEquationComponentA()*nP.getX() +
	    				this.getEquationComponentB()*nP.getY() +
	    				this.getEquationComponentC()*nP.getZ()));
    	}
    	
		clearBufferedValues();
	}
822564
public void rotate(float w, float x, float y, float z) {
        NativeTransform.rotate(getNative(), w, x, y, z);
    }
399134
public void rotate(double angle)
    {
        final double x2 = x + width;
        final double y2 = y;

        final double x3 = x2;
        final double y3 = y + height;

        final double x4 = x;
        final double y4 = y3;

        final double cx = x + width / 2.0;
        final double cy = y + height / 2.0;

        final double a = UtilMath.wrapDouble(angle, 0, 360);
        final double cos = UtilMath.cos(a);
        final double sin = UtilMath.sin(a);

        final double rx1 = cos * (x - cx) - sin * (y - cy) + cx;
        final double ry1 = sin * (x - cx) + cos * (y - cy) + cy;

        final double rx2 = cos * (x2 - cx) - sin * (y2 - cy) + cx;
        final double ry2 = sin * (x2 - cx) + cos * (y2 - cy) + cy;

        final double rx3 = cos * (x3 - cx) - sin * (y3 - cy) + cx;
        final double ry3 = sin * (x3 - cx) + cos * (y3 - cy) + cy;

        final double rx4 = cos * (x4 - cx) - sin * (y4 - cy) + cx;
        final double ry4 = sin * (x4 - cx) + cos * (y4 - cy) + cy;

        final double nx1 = Math.min(Math.min(Math.min(rx1, rx2), rx3), rx4);
        final double ny1 = Math.max(Math.max(Math.max(ry1, ry2), ry3), ry4);

        final double nx2 = Math.max(Math.max(Math.max(rx1, rx2), rx3), rx4);

        final double ny3 = Math.min(Math.min(Math.min(ry1, ry2), ry3), ry4);

        x = nx1;
        y = ny3;
        width = nx2 - nx1;
        height = ny1 - ny3;
    }
444600
public Matrix4x3f rotateAround(Quaternionfc quat, float ox, float oy, float oz, Matrix4x3f dest) {
        if ((properties & PROPERTY_IDENTITY) != 0)
            return rotationAround(quat, ox, oy, oz);
        return rotateAroundAffine(quat, ox, oy, oz, dest);
    }
292230
public void rotateByAxis(float angle, float x, float y, float z) {
        getTransform().rotateByAxis(angle, x, y, z);
        if (mTransformCache.rotateByAxis(angle, x, y, z)) {
            onTransformChanged();
        }
    }
1161711
public Matrix4f rotateAround(Quaternionfc quat, float ox, float oy, float oz, Matrix4f dest) {
        if ((properties & PROPERTY_IDENTITY) != 0)
            return rotationAround(quat, ox, oy, oz);
        else if ((properties & PROPERTY_AFFINE) != 0)
            return rotateAroundAffine(quat, ox, oy, oz, dest);
        return rotateAroundGeneric(quat, ox, oy, oz, dest);
    }
230112
public Point unrotateAndScalePoint(int x, int y, Point reuse) {
		return applyMatrixToPoint(x, y, reuse, mUnrotateAndScaleMatrix, mOrientation != 0);
	}
804356
public Rotation offset(float x, float y, float z)
	{
		offsetX = x;
		offsetY = y;
		offsetZ = z;
		return this;
	}
233021
public void setRotation(String rotation) {
        if (rotation != null) {
            try {
                setRotation(Integer.parseInt(rotation));
            } catch (NumberFormatException e) {
                setRotation(-1);
            }
        }
    }