performs a counter-clockwise rotation
686
void rotateGridCCW( Grid g ) {

		work.clear();
		for (int i = 0; i < g.rows * g.columns; i++) {
			work.add(null);
		}

		for (int row = 0; row < g.rows; row++) {
			for (int col = 0; col < g.columns; col++) {
				work.set(col*g.rows + row, g.get(g.rows - row - 1,col));
			}
		}

		g.ellipses.clear();
		g.ellipses.addAll(work);
		int tmp = g.columns;
		g.columns = g.rows;
		g.rows = tmp;
	}
27614
def flipped(self):
        """"""
        forward, reverse = self.value
        return self.__class__((reverse, forward))
968827
private function rotateLL()
	{
		$value_before		=& $this->value;
		$right_before		=& $this->right;
		$this->value		=& $this->left->value;
		$this->right		=& $this->left;
		$this->left			=& $this->left->left;
		$this->right->left	=& $this->right->right;
		$this->right->right	=& $right_before;
		$this->right->value	=& $value_before;
	}
628979
def clockwise?
	    edges.map {|e| (e.last.x - e.first.x) * (e.last.y + e.first.y)}.reduce(:+) >= 0
	end
723898
private static boolean isLeftTurn(Point2D a, Point2D b, Point2D c) {
        return winding(a, b, c) > 0;
    }
216361
function _rotateToOrientaion(width, height, orientation) {
			switch (orientation) {
				case 5:
				case 6:
				case 7:
				case 8:
					_canvas.width = height;
					_canvas.height = width;
					break;
				default:
					_canvas.width = width;
					_canvas.height = height;
			}

			/**
			1 = The 0th row is at the visual top of the image, and the 0th column is the visual left-hand side.
			2 = The 0th row is at the visual top of the image, and the 0th column is the visual right-hand side.
			3 = The 0th row is at the visual bottom of the image, and the 0th column is the visual right-hand side.
			4 = The 0th row is at the visual bottom of the image, and the 0th column is the visual left-hand side.
			5 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual top.
			6 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual top.
			7 = The 0th row is the visual right-hand side of the image, and the 0th column is the visual bottom.
			8 = The 0th row is the visual left-hand side of the image, and the 0th column is the visual bottom.
			*/

			var ctx = _canvas.getContext('2d');
			switch (orientation) {
				case 2:
					// horizontal flip
					ctx.translate(width, 0);
					ctx.scale(-1, 1);
					break;
				case 3:
					// 180 rotate left
					ctx.translate(width, height);
					ctx.rotate(Math.PI);
					break;
				case 4:
					// vertical flip
					ctx.translate(0, height);
					ctx.scale(1, -1);
					break;
				case 5:
					// vertical flip + 90 rotate right
					ctx.rotate(0.5 * Math.PI);
					ctx.scale(1, -1);
					break;
				case 6:
					// 90 rotate right
					ctx.rotate(0.5 * Math.PI);
					ctx.translate(0, -height);
					break;
				case 7:
					// horizontal flip + 90 rotate right
					ctx.rotate(0.5 * Math.PI);
					ctx.translate(width, -height);
					ctx.scale(-1, 1);
					break;
				case 8:
					// 90 rotate left
					ctx.rotate(-0.5 * Math.PI);
					ctx.translate(-width, 0);
					break;
			}
		}
731151
def rotate_window(self, count=1):
        "  "
        w = self.get_active_window()
        w.rotate(count=count)
825676
def rotate_pt(x_arr, y_arr, theta_deg, xoff=0, yoff=0):
    
    # TODO: use opencv acceleration if available
    a_arr = x_arr - xoff
    b_arr = y_arr - yoff
    cos_t = np.cos(np.radians(theta_deg))
    sin_t = np.sin(np.radians(theta_deg))
    ap = (a_arr * cos_t) - (b_arr * sin_t)
    bp = (a_arr * sin_t) + (b_arr * cos_t)
    return np.asarray((ap + xoff, bp + yoff))
1126800
def do_rotation(self, mirror, rot):
        """"""
        if (mirror):
            raise IIIFError(code=501, parameter="rotation",
                            text="Null manipulator does not support mirroring.")
        if (rot != 0.0):
            raise IIIFError(code=501, parameter="rotation",
                            text="Null manipulator supports only rotation=(0|360).")
798235
async function wheelTimedOut(element) {

  // Snap to the closest item.
  const swipeFraction = element.state.swipeFraction;
  let gesture;
  if (swipeFraction <= -0.5) {
    gesture = symbols.swipeLeft;
  } else if (swipeFraction >= 0.5) {
    gesture = symbols.swipeRight;
  }

  // TODO: Listen for the transition to complete, and then restore
  // dragging to false (or the previous value).
  resetWheelTracking(element);
  element.setState({ swipeFraction: null });

  if (gesture && element[gesture]) {
    await element[gesture]();
  }
}
327588
def do_rotation(self, mirror, rot):
        """"""
        if (not mirror and rot == 0.0):
            self.logger.debug("rotation: no rotation (nop)")
        else:
            # FIXME - with PIL one can use the transpose() method to do 90deg
            # FIXME - rotations as well as mirroring. This would be more efficient
            # FIXME - for these cases than mirror _then_ rotate.
            if (mirror):
                self.logger.debug("rotation: mirror (about vertical axis)")
                self.image = self.image.transpose(Image.FLIP_LEFT_RIGHT)
            if (rot != 0.0):
                self.logger.debug("rotation: by %f degrees clockwise" % (rot))
                self.image = self.image.rotate(-rot, expand=True)
245259
function(e) {
        var dx,
            dy,
            rot = this.rotation * DEG_TO_RAD,
            points = this.map.points;

        // Depending on the change of axis, move the corners of the rectangle appropriately
        if (e.axis === "w") {
            if (rot) {
                dx = e.amount * Math.cos(rot);
                dy = e.amount * Math.sin(rot);
            } else {
                dx = e.amount;
                dy = 0;
            }

            // "top right" point shifts on change of w
            points[2] += dx;
            points[3] += dy;
        } else {
            if (rot) {
                dy = e.amount * Math.cos(rot);
                dx = -e.amount * Math.sin(rot);
            } else {
                dx = 0;
                dy = e.amount;
            }

            // "bottom left" point shifts on change of h
            points[6] += dx;
            points[7] += dy;
        }

        // "bottom right" point shifts on either change
        points[4] += dx;
        points[5] += dy;
    }
1159640
private function rotateRR()
	{
		$value_before		=& $this->value;
		$left_before		=& $this->left;
		$this->value		=& $this->right->value;
		$this->left			=& $this->right;
		$this->right		=& $this->right->right;
		$this->left->right	=& $this->left->left;
		$this->left->left	=& $left_before;
		$this->left->value	=& $value_before;
	}
220048
function ( progress ) {
            if ( $B.isNumber(progress) ) {
                if ( !this._disabed ) {
                    var clockwise = ( this._progress < progress ),
                        grow = this._getGrow( this._progress, progress, clockwise ),
                        center = this._centerPoint,
                        degree = this._progressToDeg( progress ),
                        point = this._getPoint( degree, center );
    
                    this._dispatch( 'rotation', undefined, degree, point, point, center, grow );
                }
                return this;
            } else {
                return this._progress;
            }
        }
808256
def rotate_in_plane(chi, phase):
    """"""
    v = chi.T
    sp = np.sin(phase)
    cp = np.cos(phase)
    res = 1.*v
    res[0] = v[0]*cp + v[1]*sp
    res[1] = v[1]*cp - v[0]*sp
    return res.T
1229431
private void rotateNeedle(double value) {
        double startOffsetAngle = 180 - startAngle;
        double targetAngle;
        if (NeedleBehavior.STANDARD == needleBehavior) {
            if (ScaleDirection.CLOCKWISE == gauge.getScaleDirection()) {
                targetAngle = startOffsetAngle + (value - minValue) * angleStep;
                targetAngle = Helper.clamp(startOffsetAngle, startOffsetAngle + angleRange, targetAngle);
            } else {
                targetAngle = startOffsetAngle - (value - minValue) * angleStep;
                targetAngle = Helper.clamp(startOffsetAngle - angleRange, startOffsetAngle, targetAngle);
            }
        } else {
            if (value < minValue) value = maxValue - minValue + value;
            if (value > maxValue) value = value - maxValue + minValue;
            if (ScaleDirection.CLOCKWISE == gauge.getScaleDirection()) {
                targetAngle = startOffsetAngle + (value - minValue) * angleStep;
                targetAngle = Helper.clamp(startOffsetAngle, startOffsetAngle + angleRange, targetAngle);
            } else {
                targetAngle = startOffsetAngle - (value - minValue) * angleStep;
                targetAngle = Helper.clamp(startOffsetAngle - angleRange, startOffsetAngle, targetAngle);
            }
        }

        needleRotate.setAngle(targetAngle);
        valueText.setText(formatNumber(gauge.getLocale(), gauge.getFormatString(), gauge.getDecimals(), value));
        if (gauge.isLcdVisible()) {
            valueText.setTranslateX((0.691 * size - valueText.getLayoutBounds().getWidth()));
        } else {
            valueText.setTranslateX((size - valueText.getLayoutBounds().getWidth()) * 0.5);
        }

        if (gauge.isAverageVisible()) drawAverage();
    }
41670
def rotate_left(self, seconds=None):
        """"""
        self._move(speed=0, steering=STEER_MAX, seconds=seconds)