Converts x, y given in the scene coordinates to sprite's local ones
        coordinates
168845
def from_scene_coords(self, x=0, y=0):
        """"""
        matrix = self.get_matrix()
        matrix.invert()
        return matrix.transform_point(x, y)
437516
private void process(int x,int y)
    {
        int A = getSourcePixel(x-1,y-1);
        int B = getSourcePixel(x,y-1);
        int C = getSourcePixel(x+1,y-1);
        int D = getSourcePixel(x-1,y);
        int E = getSourcePixel(x,y);
        int F = getSourcePixel(x+1,y);
        int G = getSourcePixel(x-1,y+1);
        int H = getSourcePixel(x,y+1);
        int I = getSourcePixel(x+1,y+1);
        int E0 = E;
        int E1 = E;
        int E2 = E;
        int E3 = E;
        
        if (different(B,H) && different(D,F)) {
            E0 = !different(D,B) ? D : E;
            E1 = !different(B,F) ? F : E;
            E2 = !different(D,H) ? D : E;
            E3 = !different(H,F) ? F : E;
        }
        
        setDestPixel(x*2,y*2,E0);
        setDestPixel((x*2)+1,y*2,E1);
        setDestPixel((x*2),(y*2)+1,E2);
        setDestPixel((x*2)+1,(y*2)+1,E3);
    }
159366
def _pixel_to_tile(x: float, y: float) -> Tuple[float, float]:
    """"""
    xy = tcod.ffi.new("double[2]", (x, y))
    tcod.lib.TCOD_sys_pixel_to_tile(xy, xy + 1)
    return xy[0], xy[1]
998752
function pixelToTileCoords(x, y, v) {
         var q, r;
         var ret = v || new me.Vector2d();

         if (this.staggeraxis === "x") {
           //flat top
           x = x - (this.staggerindex === "odd" ? this.sideoffsetx : this.tilewidth);
         } else {
           //pointy top
           y = y - (this.staggerindex === "odd" ? this.sideoffsety : this.tileheight);
         } // Start with the coordinates of a grid-aligned tile


         var referencePoint = me.pool.pull("me.Vector2d", Math.floor(x / (this.columnwidth * 2)), Math.floor(y / (this.rowheight * 2))); // Relative x and y position on the base square of the grid-aligned tile

         var rel = me.pool.pull("me.Vector2d", x - referencePoint.x * (this.columnwidth * 2), y - referencePoint.y * (this.rowheight * 2)); // Adjust the reference point to the correct tile coordinates

         if (this.staggeraxis === "x") {
           referencePoint.x = referencePoint.x * 2;

           if (this.staggerindex === "even") {
             ++referencePoint.x;
           }
         } else {
           referencePoint.y = referencePoint.y * 2;

           if (this.staggerindex === "even") {
             ++referencePoint.y;
           }
         } // Determine the nearest hexagon tile by the distance to the center


         var left, top, centerX, centerY;

         if (this.staggeraxis === "x") {
           left = this.sidelengthx / 2;
           centerX = left + this.columnwidth;
           centerY = this.tileheight / 2;
           this.centers[0].set(left, centerY);
           this.centers[1].set(centerX, centerY - this.rowheight);
           this.centers[2].set(centerX, centerY + this.rowheight);
           this.centers[3].set(centerX + this.columnwidth, centerY);
         } else {
           top = this.sidelengthy / 2;
           centerX = this.tilewidth / 2;
           centerY = top + this.rowheight;
           this.centers[0].set(centerX, top);
           this.centers[1].set(centerX - this.columnwidth, centerY);
           this.centers[2].set(centerX + this.columnwidth, centerY);
           this.centers[3].set(centerX, centerY + this.rowheight);
         }

         var nearest = 0;
         var minDist = Number.MAX_VALUE;
         var dc;

         for (var i = 0; i < 4; ++i) {
           dc = Math.pow(this.centers[i].x - rel.x, 2) + Math.pow(this.centers[i].y - rel.y, 2);

           if (dc < minDist) {
             minDist = dc;
             nearest = i;
           }
         }

         var offsets = this.staggeraxis === "x" ? offsetsStaggerX : offsetsStaggerY;
         q = referencePoint.x + offsets[nearest].x;
         r = referencePoint.y + offsets[nearest].y;
         me.pool.push(referencePoint);
         me.pool.push(rel);
         return ret.set(q, r);
       }
1352684
def spline_interpolate(x1, y1, x2):
    
    sp = Spline(x1, y1)
    return sp(x2)
974426
function(x,y) {
      var ctxt = this.getContext();
	   var imgData = ctxt.getImageData(x,y,1,1);
	   var pixel = imgData.data;
	   return !( pixel[0] === 0 && pixel[1] === 0 && pixel[2] === 0 && pixel[3] === 0 );
   }
19461
def get_axes(x, y):
    
    n=int(np.sqrt(len(x)))
    if n**2 != len(x):
        raise ValueError("lenght of input array given as %s is not square of integer number!" % (len(x)))
    x_image = x.reshape(n,n)
    y_image = y.reshape(n,n)
    x_axes = x_image[0,:]
    y_axes = y_image[:,0]
    return x_axes, y_axes
36244
function (x0, y0, width, height, c)
    {
        _c = c || _c
        const data = _c.getImageData(x0, y0, width, height)
        const bits = data.data

        const pixels = []
        for (let y = 0; y < height; y += _scale)
        {
            for (let x = 0; x < width; x += _scale)
            {
                const index = x * 4 + y * width * 4
                if (bits[index + 3] === 0)
                {
                    pixels.push(null)
                }
                else
                {
                    const color = Color.rgbToHex(bits[index], bits[index + 1], bits[index + 2])
                    pixels.push(parseInt(color, 16))
                }
            }
        }
        return pixels
    }
961518
function(x, y) {
            var m0 = this.m[0],
                m1 = this.m[1],
                m2 = this.m[2],
                m3 = this.m[3],
                m4 = this.m[4],
                m5 = this.m[5],
                yt = ((m0 * (y - m5)) - (m1 * (x - m4))) / ((m0 * m3) - (m1 * m2)),
                xt = (x - m4 - (m2 * yt)) / m0;

            return this.translate(xt, yt);
        }
448726
function(e, local, decoratee, absolute, smoothOrigin) {
				var tm = e._gsTransform,
					m = _getMatrix(e, true),
					v, x, y, xOrigin, yOrigin, a, b, c, d, tx, ty, determinant, xOriginOld, yOriginOld;
				if (tm) {
					xOriginOld = tm.xOrigin; //record the original values before we alter them.
					yOriginOld = tm.yOrigin;
				}
				if (!absolute || (v = absolute.split(" ")).length < 2) {
					b = e.getBBox();
					local = _parsePosition(local).split(" ");
					v = [(local[0].indexOf("%") !== -1 ? parseFloat(local[0]) / 100 * b.width : parseFloat(local[0])) + b.x,
						 (local[1].indexOf("%") !== -1 ? parseFloat(local[1]) / 100 * b.height : parseFloat(local[1])) + b.y];
				}
				decoratee.xOrigin = xOrigin = parseFloat(v[0]);
				decoratee.yOrigin = yOrigin = parseFloat(v[1]);
				if (absolute && m !== _identity2DMatrix) { //if svgOrigin is being set, we must invert the matrix and determine where the absolute point is, factoring in the current transforms. Otherwise, the svgOrigin would be based on the element's non-transformed position on the canvas.
					a = m[0];
					b = m[1];
					c = m[2];
					d = m[3];
					tx = m[4];
					ty = m[5];
					determinant = (a * d - b * c);
					x = xOrigin * (d / determinant) + yOrigin * (-c / determinant) + ((c * ty - d * tx) / determinant);
					y = xOrigin * (-b / determinant) + yOrigin * (a / determinant) - ((a * ty - b * tx) / determinant);
					xOrigin = decoratee.xOrigin = v[0] = x;
					yOrigin = decoratee.yOrigin = v[1] = y;
				}
				if (tm) { //avoid jump when transformOrigin is changed - adjust the x/y values accordingly
					if (smoothOrigin || (smoothOrigin !== false && CSSPlugin.defaultSmoothOrigin !== false)) {
						x = xOrigin - xOriginOld;
						y = yOrigin - yOriginOld;
						//originally, we simply adjusted the x and y values, but that would cause problems if, for example, you created a rotational tween part-way through an x/y tween. Managing the offset in a separate variable gives us ultimate flexibility.
						//tm.x -= x - (x * m[0] + y * m[2]);
						//tm.y -= y - (x * m[1] + y * m[3]);
						tm.xOffset += (x * m[0] + y * m[2]) - x;
						tm.yOffset += (x * m[1] + y * m[3]) - y;
					} else {
						tm.xOffset = tm.yOffset = 0;
					}
				}
				e.setAttribute("data-svg-origin", v.join(" "));
			}
1289777
function (x, y) {
                var matrix = selectedShape.node().getCTM(),
                    position = chart.svg.node().createSVGPoint();
                position.x = x || 0;
                position.y = y || 0;
                return position.matrixTransform(matrix);
            }
59156
def get_scene(self):
        
        return self._x, self._y, self._hsml, self._m, self._kview
797976
def coords_on_grid(self, x, y):
        

        if isinstance(x, float):
            x = int(self._round(x))
        if isinstance(y, float):
            y = int(self._round(y))
        if not self._y_coord_down:
            y = self._extents - y
        return x, y
6926
def move(self, x, y):
        
        if self.brush_on:
            for lx, ly in line(self.pos_x, self.pos_y, x, y):
                self.set(lx, ly)

        self.pos_x = x
        self.pos_y = y
417471
def pixels_to_tiles(self, coords, clamp=True):
        
        tile_coords = Vector2()
        tile_coords.X = int(coords[0]) / self.spritesheet[0].width
        tile_coords.Y = int(coords[1]) / self.spritesheet[0].height

        if clamp:
            tile_coords.X, tile_coords.Y = self.clamp_within_range(tile_coords.X, tile_coords.Y)

        return tile_coords
219958
def _transform(self, X, y):
        '''
        
        '''
        z, p, y_rle = self._rle(y)
        p = np.append(p, len(y))
        big_enough = p[1:] - p[:-1] >= self.min_length
        Xt = []

        for i in range(len(y_rle)):
            if (big_enough[i]):
                Xt.append(X[p[i]:p[i+1]])

        yt = y_rle[big_enough].tolist()
        return Xt, yt
220978
function playgroundPosition() {
  var pos  = parseInt($('#reelPosition').val());
  if (isNaN(pos)) pos = 0;
  spriteAnimation.reelPosition(pos);
}