Orbit around the point ``Camera.pivot`` by the angle
        *angle* expressed in radians. The axis of rotation is the
        camera "right" vector, ``Camera.a``.

        In practice, we move around a point like if we were on a Ferris
        wheel.
354300
def orbit_y(self, angle):
        '''

        '''
        
        # Subtract pivot point
        self.position -= self.pivot
        
        # Rotate
        rot = rotation_matrix(-angle, self.b)[:3,:3]
        self.position = np.dot(rot, self.position)
        
        # Add again the pivot point
        self.position += self.pivot
        
        self.a = np.dot(rot, self.a)
        self.b = np.dot(rot, self.b)
        self.c = np.dot(rot, self.c)
152677
function(points, angle) {
    var result = [];
    for(var i=0;i<points.length;i+=2) {
      var x = points[i + 0] * this._size;
      var y = points[i + 1] * this._size;
      var pt = this._rotate([x, y], angle);
      result.push(pt[0]);
      result.push(pt[1]);
    }
    return result;
  }
1239711
def rotate(self, azimuth, axis=None):
        
        target = self._target

        y_axis = self._n_pose[:3, 1].flatten()
        if axis is not None:
            y_axis = axis
        x_rot_mat = transformations.rotation_matrix(azimuth, y_axis, target)
        self._n_pose = x_rot_mat.dot(self._n_pose)

        y_axis = self._pose[:3, 1].flatten()
        if axis is not None:
            y_axis = axis
        x_rot_mat = transformations.rotation_matrix(azimuth, y_axis, target)
        self._pose = x_rot_mat.dot(self._pose)
905934
function(other) {
		var r0 = this._points();
		var r1 = other._points();
		var axes = [
			toAxis(r0[0], r0[1]),
			toAxis(r0[0], r0[3])
		];
		var i, pr0, pr1;

		if (this._rotation !== other._rotation) {
			// Only separate with r1 axis if the rotation is different,
			// else it's enough to separate r0 and r1 with r0 axis only!
			axes.push(
				toAxis(r1[0], r1[1]),
				toAxis(r1[0], r1[3])
			);
		}

		for (i = 0; i < axes.length; ++i) {
			pr0 = projected(r0, axes[i]);
			pr1 = projected(r1, axes[i]);

			if (pr0.max < pr1.min || pr1.max < pr0.min) {
				return false;
			}
		}

		return true;
	}
769039
def rotate_x(self, deg):
        
        rad = math.radians(deg)
        mat = numpy.array([
            [1, 0, 0, 0],
            [0, math.cos(rad), math.sin(rad), 0],
            [0, -math.sin(rad), math.cos(rad), 0],
            [0, 0, 0, 1]
        ])
        self.vectors = self.vectors.dot(mat)
        return self
831290
def rotate(angle, axis, dtype=None):
    
    angle = np.radians(angle)
    assert len(axis) == 3
    x, y, z = axis / np.linalg.norm(axis)
    c, s = math.cos(angle), math.sin(angle)
    cx, cy, cz = (1 - c) * x, (1 - c) * y, (1 - c) * z
    M = np.array([[cx * x + c, cy * x - z * s, cz * x + y * s, .0],
                  [cx * y + z * s, cy * y + c, cz * y - x * s, 0.],
                  [cx * z - y * s, cy * z + x * s, cz * z + c, 0.],
                  [0., 0., 0., 1.]], dtype).T
    return M
720765
def axis_rotation(points, angle, inplace=False, deg=True, axis='z'):
    
    axis = axis.lower()

    # Copy original array to if not inplace
    if not inplace:
        points = points.copy()

    # Convert angle to radians
    if deg:
        angle *= np.pi / 180

    if axis == 'x':
        y = points[:, 1] * np.cos(angle) - points[:, 2] * np.sin(angle)
        z = points[:, 1] * np.sin(angle) + points[:, 2] * np.cos(angle)
        points[:, 1] = y
        points[:, 2] = z
    elif axis == 'y':
        x = points[:, 0] * np.cos(angle) + points[:, 2] * np.sin(angle)
        z = - points[:, 0] * np.sin(angle) + points[:, 2] * np.cos(angle)
        points[:, 0] = x
        points[:, 2] = z
    elif axis == 'z':
        x = points[:, 0] * np.cos(angle) - points[:, 1] * np.sin(angle)
        y = points[:, 0] * np.sin(angle) + points[:, 1] * np.cos(angle)
        points[:, 0] = x
        points[:, 1] = y
    else:
        raise Exception('invalid axis.  Must be either "x", "y", or "z"')

    if not inplace:
        return points
688498
async def move_camera(self, position: Union[Unit, Point2, Point3]):
        
        assert isinstance(position, (Unit, Point2, Point3))
        if isinstance(position, Unit):
            position = position.position
        await self._execute(
            action=sc_pb.RequestAction(
                actions=[
                    sc_pb.Action(
                        action_raw=raw_pb.ActionRaw(
                            camera_move=raw_pb.ActionRawCameraMove(
                                center_world_space=common_pb.Point(x=position.x, y=position.y)
                            )
                        )
                    )
                ]
            )
        )
1324362
def rotate_view(self, axis_ind=0, angle=0):
        
        camera = self.ren.GetActiveCamera()
        if axis_ind == 0:
            camera.Roll(angle)
        elif axis_ind == 1:
            camera.Azimuth(angle)
        else:
            camera.Pitch(angle)
        self.ren_win.Render()
650596
function rotateY(out, a, b, c){
    var bx = b[0]
    var bz = b[2]

    // translate point to the origin
    var px = a[0] - bx
    var pz = a[2] - bz
    
    var sc = Math.sin(c)
    var cc = Math.cos(c)
  
    // perform rotation and translate to correct position
    out[0] = bx + pz * sc + px * cc
    out[1] = a[1]
    out[2] = bz + pz * cc - px * sc
  
    return out
}
618931
public double[] getCameraDirection() {
        double[] cameraDirection = new double[3];
        double l = Math.sqrt(Math.pow(this.eyeX - this.centerX, 2.0) + Math.pow(this.eyeZ - this.centerZ, 2.0) + Math.pow(this.eyeZ - this.centerZ, 2.0));
        cameraDirection[0] = (this.centerX - this.eyeX) / l;
        cameraDirection[1] = (this.centerY - this.eyeY) / l;
        cameraDirection[2] = (this.centerZ - this.eyeZ) / l;
        return cameraDirection;
    }
86334
def get_rotated(self, angle):
        
        result = self.copy()
        result.rotate(angle)
        return result
213749
def reference_to_greatcircle(reference_frame, greatcircle_frame):
    """"""

    # Define rotation matrices along the position angle vector, and
    # relative to the origin.
    pole = greatcircle_frame.pole.transform_to(coord.ICRS)
    ra0 = greatcircle_frame.ra0
    center = greatcircle_frame.center
    R_rot = rotation_matrix(greatcircle_frame.rotation, 'z')

    if not np.isnan(ra0):
        xaxis = np.array([np.cos(ra0), np.sin(ra0), 0.])
        zaxis = pole.cartesian.xyz.value
        if np.abs(zaxis[2]) >= 1e-15:
            xaxis[2] = -(zaxis[0]*xaxis[0] + zaxis[1]*xaxis[1]) / zaxis[2] # what?
        else:
            xaxis[2] = 0.
        xaxis = xaxis / np.sqrt(np.sum(xaxis**2))
        yaxis = np.cross(zaxis, xaxis)
        R = np.stack((xaxis, yaxis, zaxis))

    elif center is not None:
        R1 = rotation_matrix(pole.ra, 'z')
        R2 = rotation_matrix(90*u.deg - pole.dec, 'y')
        Rtmp = matrix_product(R2, R1)

        rot = center.cartesian.transform(Rtmp)
        rot_lon = rot.represent_as(coord.UnitSphericalRepresentation).lon
        R3 = rotation_matrix(rot_lon, 'z')
        R = matrix_product(R3, R2, R1)

    else:
        R1 = rotation_matrix(pole.ra, 'z')
        R2 = rotation_matrix(pole.dec, 'y')
        R = matrix_product(R2, R1)

    return matrix_product(R_rot, R)
592724
def rotate_around(self, axis, theta):
        

        # Adapted from equations published by Glenn Murray.
        # http://inside.mines.edu/~gmurray/ArbitraryAxisRotation/ArbitraryAxisRotation.html
        x, y, z = self.x, self.y, self.z
        u, v, w = axis.x, axis.y, axis.z

        # Extracted common factors for simplicity and efficiency
        r2 = u**2 + v**2 + w**2
        r = math.sqrt(r2)
        ct = math.cos(theta)
        st = math.sin(theta) / r
        dt = (u * x + v * y + w * z) * (1 - ct) / r2
        return Vector3((u * dt + x * ct + (-w * y + v * z) * st),
                       (v * dt + y * ct + (w * x - u * z) * st),
                       (w * dt + z * ct + (-v * x + u * y) * st))
269932
@Override
	public boolean process(double x, double y) {

		leftPixelToRect.compute(x,y,pixelRect);

		// round to the nearest pixel
		if( !disparity.process((int)(pixelRect.x+0.5),(int)(pixelRect.y+0.5)) )
			return false;

		// Compute coordinate in camera frame
		this.w = disparity.getDisparity();
		computeHomo3D(pixelRect.x, pixelRect.y, pointLeft);

		return true;
	}
571282
def viewAngle(self, **kwargs):
        '''
        
        '''
        v0 = self.cam2PlaneVectorField(**kwargs)
        # obj cannot be behind camera
        v0[2][v0[2] < 0] = np.nan

        _t, r = self.pose()
        n = self.planeSfN(r)
        # because of different x,y orientation:
        n[2] *= -1
#         beta2 = vectorAngle(v0, vectorToField(n) )
        beta2 = vectorAngle(v0, n)
        return beta2
825631
def rotation_matrix_from_axis_and_angle(u, theta):
    ''''''
    
    x = u[0]
    y = u[1]
    z = u[2]
    s = np.sin(theta)
    c = np.cos(theta)
    
    return np.array([[c + x**2 * (1 - c), x * y * (1 - c) - z * s, x * z * (1 - c) + y * s],
                     [y * x * (1 - c) + z * s, c + y**2 * (1 - c), y * z * (1 - c) - x * s ],
                     [z * x * (1 - c) - y * s, z * y * (1 - c) + x * s, c + z**2 * (1 - c) ]])