Rotate the table horizontally

 @api private
486170
def rotate_horizontal
      return unless rotated?
      head, body = orientation.slice(self)
      if header && header.empty?
        @header = head[0]
        @rows   = body.map { |row| to_row(row, @header) }
      else
        @rows = body.map { |row| to_row(row) }
      end
    end
301232
private RedBlackTreeNode<Key, Value> rotateRight(RedBlackTreeNode<Key, Value> h) {
	// assert (h != null) && h.getLeft().isRed();
	RedBlackTreeNode<Key, Value> x = h.getLeft();
	h.setLeft(x.getRight());
	x.setRight(h);
	x.setColor(x.getRight().getColor());
	x.getRight().setColor(RED);
	x.setSize(h.getSize());
	h.setSize(size(h.getLeft()) + size(h.getRight()) + 1);
	return x;
    }
732368
private Node rotateLeft(Node node) {
        Node leftChild = node.left;
        node.left = leftChild.right;
        leftChild.right = node;
        node.height = calculateHeight(getHeight(node.left), getHeight(node.right));
        leftChild.height = calculateHeight(getHeight(leftChild.left), node.height);
        return leftChild;
    }
859801
function transformCoordinate(canvas, 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;
        }
        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;
            default:
                break;
        }
    }
1354069
function _rotateSelection(distance) {
            var len = Math.min(self.hints.length, self.maxResults),
                pos;

            if (self.selectedIndex < 0) {
                // set the initial selection
                pos = (distance > 0) ? distance - 1 : len - 1;

            } else {
                // adjust current selection
                pos = self.selectedIndex;

                // Don't "rotate" until all items have been shown
                if (distance > 0) {
                    if (pos === (len - 1)) {
                        pos = 0;  // wrap
                    } else {
                        pos = Math.min(pos + distance, len - 1);
                    }
                } else {
                    if (pos === 0) {
                        pos = (len - 1);  // wrap
                    } else {
                        pos = Math.max(pos + distance, 0);
                    }
                }
            }

            self._setSelectedIndex(pos);
        }
380738
function rotateLeft (node) {
  var rightNode = node.right;
  node.right    = rightNode.left;

  if (rightNode.left) rightNode.left.parent = node;

  rightNode.parent = node.parent;
  if (rightNode.parent) {
    if (rightNode.parent.left === node) {
      rightNode.parent.left = rightNode;
    } else {
      rightNode.parent.right = rightNode;
    }
  }

  node.parent    = rightNode;
  rightNode.left = node;

  node.balanceFactor += 1;
  if (rightNode.balanceFactor < 0) {
    node.balanceFactor -= rightNode.balanceFactor;
  }

  rightNode.balanceFactor += 1;
  if (node.balanceFactor > 0) {
    rightNode.balanceFactor += node.balanceFactor;
  }
  return rightNode;
}
935490
private Node rotateRight(Node node) {
        Node rightChild = node.right;
        node.right = rightChild.left;
        rightChild.left = node;
        node.height = calculateHeight(getHeight(node.left), getHeight(node.right));
        rightChild.height = calculateHeight(getHeight(rightChild.right), node.height);
        return rightChild;
    }
31850
function( arr ) {
		var minWidth = 0, minHeight = 0;

		for( var i = 0; i < arr.length; ++i ) {
			minWidth = Math.max( arr[ i ].minWidth || 0, minWidth );
			minHeight = Math.max( arr[ i ].minHeight || 0, minHeight );
		}

		return { horizontal: minWidth, vertical: minHeight };
	}
1284593
def move_red_right(self):
        

        self = self.flip()
        if self.left is not NULL and self.left.left.red:
            self = self.rotate_right().flip()

        return self
741885
private MtasRBTreeNode rotateRight(MtasRBTreeNode n) {
    assert (n != null) && isRed(n.leftChild);
    MtasRBTreeNode x = n.leftChild;
    n.leftChild = x.rightChild;
    x.rightChild = n;
    x.color = x.rightChild.color;
    x.rightChild.color = MtasRBTreeNode.RED;
    x.n = n.n;
    n.n = size(n.leftChild) + size(n.rightChild) + 1;
    setMax(n);
    setMax(x);
    return x;
  }
509927
function () {
            var wrapper = this,
              translateX = wrapper.translateX || 0,
              translateY = wrapper.translateY || 0,
              scaleX = wrapper.scaleX,
              scaleY = wrapper.scaleY,
              inverted = wrapper.inverted,
              rotation = wrapper.rotation,
              element = wrapper.element,
              transform;

            // flipping affects translate as adjustment for flipping around the group's axis
            if (inverted) {
                translateX += wrapper.attr('width');
                translateY += wrapper.attr('height');
            }

            // Apply translate. Nearly all transformed elements have translation, so instead
            // of checking for translate = 0, do it always (#1767, #1846).
            transform = ['translate(' + translateX + ',' + translateY + ')'];

            // apply rotation
            if (inverted) {
                transform.push('rotate(90) scale(-1,1)');
            } else if (rotation) { // text rotation
                transform.push('rotate(' + rotation + ' ' + (element.getAttribute('x') || 0) + ' ' + (element.getAttribute('y') || 0) + ')');
            }

            // apply scale
            if (defined(scaleX) || defined(scaleY)) {
                transform.push('scale(' + pick(scaleX, 1) + ' ' + pick(scaleY, 1) + ')');
            }

            if (transform.length) {
                element.setAttribute('transform', transform.join(' '));
            }
        }
965206
function (rotation, alignCorrection, baseline) {
            var rotationStyle = {},
              cssTransformKey = isIE ? '-ms-transform' : isWebKit ? '-webkit-transform' : isFirefox ? 'MozTransform' : isOpera ? '-o-transform' : '';

            rotationStyle[cssTransformKey] = rotationStyle.transform = 'rotate(' + rotation + 'deg)';
            rotationStyle[cssTransformKey + (isFirefox ? 'Origin' : '-origin')] = rotationStyle.transformOrigin = (alignCorrection * 100) + '% ' + baseline + 'px';
            css(this.element, rotationStyle);
        }
543382
def _rotate_tr(self):
        """"""
        rot, x, y, z = self._quaternion.get_axis_angle()
        up, forward, right = self._get_dim_vectors()
        self.transform.rotate(180 * rot / np.pi, (x, z, y))
1288112
private function rotateRight()
    {
        $left = $this->left;

        if ($left->information & 1) {
            $this->left = $left->right;
            $left->right = $this;
        } else {
            $this->information &= ~ 2;
            $left->information |= 1;
        }

        $this->information += 4;

        if ($left->information < 0) {
            $this->information -= $left->information & ~3;
        }

        $left->information += 4;

        if ($this->information >= 4) {
            $left->information += $this->information & ~3;
        }

        return $left;
    }
899391
function ($node, direction) {
      var that = this;
      var $nodeContainer = $node.closest('table').parent();
      if ($nodeContainer.siblings().find('.spinner').length) {
        $node.closest('.orgchart').data('inAjax', false);
      }
      if (direction) {
        if (direction === 'left') {
          $nodeContainer.prevAll().find('.node').filter(this.isVisibleNode.bind(this)).addClass('sliding slide-right');
        } else {
          $nodeContainer.nextAll().find('.node').filter(this.isVisibleNode.bind(this)).addClass('sliding slide-left');
        }
      } else {
        $nodeContainer.prevAll().find('.node').filter(this.isVisibleNode.bind(this)).addClass('sliding slide-right');
        $nodeContainer.nextAll().find('.node').filter(this.isVisibleNode.bind(this)).addClass('sliding slide-left');
      }
      var $animatedNodes = $nodeContainer.siblings().find('.sliding');
      var $lines = $animatedNodes.closest('.nodes').prevAll('.lines').css('visibility', 'hidden');
      $animatedNodes.eq(0).one('transitionend', { 'node': $node, 'nodeContainer': $nodeContainer, 'direction': direction, 'animatedNodes': $animatedNodes, 'lines': $lines }, this.hideSiblingsEnd.bind(this));
    }
1258904
function rotate(angle) {
         if (angle !== 0) {
           var a = this.val,
               a0 = a[0],
               a1 = a[1],
               a3 = a[3],
               a4 = a[4],
               s = Math.sin(angle),
               c = Math.cos(angle);
           a[0] = a0 * c + a3 * s;
           a[1] = a1 * c + a4 * s;
           a[3] = a0 * -s + a3 * c;
           a[4] = a1 * -s + a4 * c;
         }

         return this;
       }
31135
function (corner) {
                var _this = this;
                /** @type {?} */
                var rotated = {
                    x: this._paneDimensions.width * (1 - corner.y),
                    y: this._paneDimensions.height * corner.x,
                    roles: []
                };
                // rotates corner according to order
                /** @type {?} */
                var order = [
                    ['bottom', 'left'],
                    ['top', 'left'],
                    ['top', 'right'],
                    ['bottom', 'right'],
                    ['bottom', 'left']
                ];
                rotated.roles = order[order.findIndex(function (roles) {
                    return _this.compareArray(roles, corner.roles);
                }) + 1];
                return rotated;
            }