Transform input to the CORDIC working quadrants
970336
def initial_step(self, phase, x, y):
        
        self.x[0] = x
        self.y[0] = y
        self.phase[0] = phase
        if self.MODE == CordicMode.ROTATION:
            if phase > 0.5:
                # > np.pi/2
                self.x[0] = -x
                self.phase[0] = phase - 1.0
            elif phase < -0.5:
                # < -np.pi/2
                self.x[0] = -x
                self.phase[0] = phase + 1.0

        elif self.MODE == CordicMode.VECTORING:
            if x < 0.0 and y > 0.0:
                # vector in II quadrant -> initial shift by PI to IV quadrant (mirror)
                self.x[0] = -x
                self.y[0] = -y
                self.phase[0] = 1.0
                # self.phase[0] = 0.0
            elif x < 0.0 and y < 0.0:
                # vector in III quadrant -> initial shift by -PI to I quadrant (mirror)
                self.x[0] = -x
                self.y[0] = -y
                self.phase[0] = -1.0
1192746
function contoursTransform(contours, transforms) {
        if (!contours || !contours.length || !transforms || !transforms.length) {
            return contours;
        }

        var matrix = [1, 0, 0, 1, 0, 0];
        for (var i = 0, l = transforms.length; i < l; i++) {
            var transform = transforms[i];
            var params = transform.params;
            switch (transform.name) {
                case 'translate':
                    matrix = matrixUtil.mul(matrix, [1, 0, 0, 1, params[0], params[1]]);
                    break;
                case 'scale':
                    matrix = matrixUtil.mul(matrix, [params[0], 0, 0, params[1], 0, 0]);
                    break;
                case 'matrix':
                    matrix = matrixUtil.mul(matrix,
                        [params[0], params[1], params[2], params[3], params[4], params[5]]);
                    break;
                case 'rotate':
                    var radian = params[0] * Math.PI / 180;
                    if (params.length > 1) {

                        matrix = matrixUtil.multiply(
                            matrix,
                            [1, 0, 0, 1, -params[1], -params[2]],
                            [Math.cos(radian), Math.sin(radian), -Math.sin(radian), Math.cos(radian), 0, 0],
                            [1, 0, 0, 1, params[1], params[2]]
                        );
                    }
                    else {
                        matrix = matrixUtil.mul(
                            matrix, [Math.cos(radian), Math.sin(radian), -Math.sin(radian), Math.cos(radian), 0, 0]);
                    }
                    break;
                case 'skewX':
                    matrix = matrixUtil.mul(matrix,
                        [1, 0, Math.tan(params[0] * Math.PI / 180), 1, 0, 0]);
                    break;
                case 'skewY':
                    matrix = matrixUtil.mul(matrix,
                        [1, Math.tan(params[0] * Math.PI / 180), 0, 1, 0, 0]);
                    break;
            }
        }

        contours.forEach(function (p) {
            pathTransform(p, matrix[0], matrix[1], matrix[2], matrix[3], matrix[4], matrix[5]);
        });

        return contours;
    }
954103
def _make_input(self, action, old_quat):
        
        return {
            "dpos": action[:3],
            # IK controller takes an absolute orientation in robot base frame
            "rotation": T.quat2mat(T.quat_multiply(old_quat, action[3:7])),
        }
734001
def transform_root(headers, ini, headers2, moves, forks)
      ret = { "header" => {}, "moves" => moves }
      headers.compact.each { |h| ret["header"][h["k"]] = h["v"] }
      headers2.compact.each { |h| ret["header"][h["k"]] = h["v"] }
      if ini
        ret["initial"] = ini
      elsif ret["header"]["手合割"]
        preset = preset2str(ret["header"]["手合割"])
        ret["initial"] = { "preset" => preset } if preset != "OTHER"
      end
      transform_root_header_data(ret) if ret["initial"] && ret["initial"]["data"]
      transform_root_forks(forks, moves)
      ret
    end
704096
def map(self, coords):
        
        for tr in reversed(self.transforms):
            coords = tr.map(coords)
        return coords
751427
function(d, cx, cy) {
    return this.transform({ rotation: d, cx: cx, cy: cy })
  }
1326258
def connect_input(self, wire):
        """"""
        self._input = wire
        wire.sinks.append(self)
1108669
def _transform_in(self):
        """"""
        return np.array([
            [self.left, self.bottom, 0, 1],
            [self.right, self.top, 0, 1]])
1102316
def _call(self, x, out):
        """"""
        with writable_array(out) as out_arr:
            resize_array(x.asarray(), self.range.shape, offset=self.offset,
                         pad_mode=self.pad_mode, pad_const=self.pad_const,
                         direction='forward', out=out_arr)
293866
def applyTransform(self):
        

        fn = self.function_table.applyTransform
        pOutputPose = TrackedDevicePose_t()
        pTrackedDevicePose = TrackedDevicePose_t()
        pTransform = HmdMatrix34_t()
        fn(byref(pOutputPose), byref(pTrackedDevicePose), byref(pTransform))
        return pOutputPose, pTrackedDevicePose, pTransform
317725
def build_interpolators(self):
        """"""
        self.phi_continuous = []
        for xi, phii in zip(self.ace.x, self.ace.x_transforms):
            self.phi_continuous.append(interp1d(xi, phii))
        self.inverse_theta_continuous = interp1d(self.ace.y_transform, self.ace.y)
762492
def translate(curve, z0):
    """"""
    if isinstance(curve, Path):
        return Path(*[translate(seg, z0) for seg in curve])
    elif is_bezier_segment(curve):
        return bpoints2bezier([bpt + z0 for bpt in curve.bpoints()])
    elif isinstance(curve, Arc):
        new_start = curve.start + z0
        new_end = curve.end + z0
        return Arc(new_start, radius=curve.radius, rotation=curve.rotation,
                   large_arc=curve.large_arc, sweep=curve.sweep, end=new_end)
    else:
        raise TypeError("Input `curve` should be a Path, Line, "
                        "QuadraticBezier, CubicBezier, or Arc object.")
812981
function cornerLine(p, quadrant, size) {

  switch (quadrant) {
    case Const.top_left: return new Pair(p).to(p.$add(size, size));
    case Const.top_right: return new Pair(p).to(p.$add(-size, size));
    case Const.bottom_left: return new Pair(p).to(p.$add(size, -size));
    case Const.bottom_right: return new Pair(p).to(p.$add(-size, -size));
    case Const.top: return new Pair(p).to(p.$add(0, size));
    case Const.bottom: return new Pair(p).to(p.$add(0, -size));
    case Const.left: return new Pair(p).to(p.$add(size, 0));
    default: return new Pair(p).to(p.$add(-size, 0));
  }
}
1347684
def _call(self, x):
        """"""
        with self.op.mutex:
            result = pyshearlab.SLshearrecadjoint2D(x, self.op.shearlet_system)
            return np.moveaxis(result, -1, 0)
640594
def convert_slice_channel(node, **kwargs):
    
    name, input_nodes, attrs = get_inputs(node, kwargs)

    num_outputs = int(attrs.get("num_outputs"))
    axis = int(attrs.get("axis", 1))
    squeeze_axis = int(attrs.get("squeeze_axis", 0))

    if squeeze_axis == 1 and num_outputs == 1:
        node = onnx.helper.make_node(
            "Squeeze",
            input_nodes,
            [name],
            axes=[axis],
            name=name,
        )
        return [node]
    elif squeeze_axis == 0 and num_outputs > 1:
        in_shape = kwargs.get('in_shape')[0]
        split = in_shape[axis] // num_outputs
        node = onnx.helper.make_node(
            "Split",
            input_nodes,
            [name+'_output'+str(i) for i in range(num_outputs)],
            axis=axis,
            split=[split for _ in range(num_outputs)],
            name=name,
        )
        return [node]
    else:
        raise NotImplementedError("SliceChannel operator with num_outputs>1 and"
                                  "squeeze_axis true is not implemented.")
306160
def transform(self, crs):
        
        new_crs = CRS(crs)
        return BBox((transform_point(self.lower_left, self.crs, new_crs),
                     transform_point(self.upper_right, self.crs, new_crs)), crs=new_crs)
364471
public static void rotateCW( GrayS32 input , GrayS32 output ) {
		if( input.width != output.height || input.height != output.width )
			throw new IllegalArgumentException("Incompatible shapes");

		int h = input.height-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(h-y,x,input.data[indexIn++]);
			}
		}
	}