Scalar displacement.
@param float $deltaX
@param float $deltaY
@return Vector
487864
public function move($deltaX, $deltaY) : Vector
    {
        return new self($this->x + $deltaX, $this->y + $deltaY);
    }
670621
public function dot(Vector $other) : float
    {
        return $this->x * $other->getX() + $this->y * $other->getY();
    }
1274054
function(delta) {
        return new $.Rect(
            this.x + delta.x,
            this.y + delta.y,
            this.width,
            this.height,
            this.degrees);
    }
151227
def _Delta(a, b):
  """"""
  if a+1 == b:
    if a%2 == 0:
      return 'EvenOdd'
    else:
      return 'OddEven'
  if a == b+1:
    if a%2 == 0:
      return 'OddEven'
    else:
      return 'EvenOdd'
  return b - a
866000
public void makeIndexDeltas(int[] indices) {
        assert indices.length % 3 == 0;

        for (int i = indices.length / 3 - 1; i >= 0; --i) {
            // Step 1: Calculate delta from second triangle index to the previous
            // second triangle index, if the previous triangle shares the same first
            // index, otherwise calculate the delta to the first triangle index
            if ((i >= 1) && (indices[i * 3] == indices[(i - 1) * 3])) {
                indices[i * 3 + 1] -= indices[(i - 1) * 3 + 1];
            } else {
                indices[i * 3 + 1] -= indices[i * 3];
            }

            // Step 2: Calculate delta from third triangle index to the first triangle
            // index
            indices[i * 3 + 2] -= indices[i * 3];

            // Step 3: Calculate derivative of the first triangle index
            if (i >= 1) {
                indices[i * 3] -= indices[(i - 1) * 3];
            }
        }
    }
1206682
def delta(n, d=None, center=0):
    
    if isinstance(n, six.integer_types):
        n = [n]
    if d is None:
        n0 = _np.asanyarray(n, dtype=_np.int32)
    else:
        n0 = _np.array(n * d, dtype=_np.int32)
    d = n0.size

    if center < 0:
        cind = [0] * d
    else:
        cind = []
        for i in xrange(d):
            cind.append(center % n0[i])
            center //= n0[i]
        if center > 0:
            cind = [0] * d
    cr = []
    for i in xrange(d):
        cur_core = _np.zeros((1, n0[i], 1))
        cur_core[0, cind[i], 0] = 1
        cr.append(cur_core)
    return _vector.vector.from_list(cr)
457977
function calculateScrollDistribution(deltaX, deltaY, element, container, accumulator = []) {
  const scrollInformation = {
    element,
    scrollLeft: 0,
    scrollTop: 0
  };
  const scrollLeftMax = element.scrollWidth - element.clientWidth;
  const scrollTopMax = element.scrollHeight - element.clientHeight;

  const availableScroll = {
    deltaXNegative: -element.scrollLeft,
    deltaXPositive: scrollLeftMax - element.scrollLeft,
    deltaYNegative: -element.scrollTop,
    deltaYPositive: scrollTopMax - element.scrollTop
  };

  const elementStyle = window.getComputedStyle(element);

  if (elementStyle.overflowX !== 'hidden') {
    // The `deltaX` can be larger than the available scroll for the element, thus overshooting.
    // The result of that is that it scrolls the element as far as possible. We don't need to
    // calculate exactly because we reduce the amount of desired scroll for the
    // parent elements by the correct amount below.
    scrollInformation.scrollLeft = element.scrollLeft + deltaX;
    if (deltaX > availableScroll.deltaXPositive) {
      deltaX = deltaX - availableScroll.deltaXPositive;
    } else if (deltaX < availableScroll.deltaXNegative) {
      deltaX = deltaX - availableScroll.deltaXNegative;
    } else {
      deltaX = 0;
    }
  }

  if (elementStyle.overflowY !== 'hidden') {
    scrollInformation.scrollTop = element.scrollTop + deltaY;
    if (deltaY > availableScroll.deltaYPositive) {
      deltaY = deltaY - availableScroll.deltaYPositive;
    } else if (deltaY < availableScroll.deltaYNegative) {
      deltaY = deltaY - availableScroll.deltaYNegative;
    } else {
      deltaY = 0;
    }
  }

  if (element !== container && (deltaX || deltaY)) {
    return calculateScrollDistribution(deltaX, deltaY, element.parentNode, container, accumulator.concat([scrollInformation]));
  }

  return accumulator.concat([scrollInformation]);
}
205524
def compute(a, b, axis):
        
        delta = []
        for aa, bb in zip(rollaxis(a, axis, 0), rollaxis(b, axis, 0)):
            delta.append(Displacement.compute(aa, bb).delta)
        return LocalDisplacement(delta, axis=axis)
1004731
public boolean eq(IntFloatSortedVector other, float delta) {
        // This is slow, but correct.
        IntFloatSortedVector v1 = IntFloatSortedVector.getWithNoZeroValues(this, delta);
        IntFloatSortedVector v2 = IntFloatSortedVector.getWithNoZeroValues(other, delta);
                
        if (v2.size() != v1.size()) {
            return false;
        }

        for (IntFloatEntry ve : v1) {
            if (!Primitives.equals(ve.get(), v2.get(ve.index()), delta)) {
                return false;
            }
        }
        for (IntFloatEntry ve : v2) {
            if (!Primitives.equals(ve.get(), v1.get(ve.index()), delta)) {
                return false;
            }
        }
        return true;
    }
1136178
def displace(self, vector):
        
        self._bottom += vector.y
        self._left += vector.x
        return self
490924
function getVelocity(deltaTime, x, y) {
    return {
        x: x / deltaTime || 0,
        y: y / deltaTime || 0
    };
}
195716
public static <T extends Geometry> JTSGeometryExpression<T> translate(Expression<T> expr, float deltax, float deltay) {
        return geometryOperation(expr.getType(), SpatialOps.TRANSLATE,
                expr, ConstantImpl.create(deltax), ConstantImpl.create(deltay));
    }
1374113
function deltaE(labA, labB) {
      var deltaL = labA[0] - labB[0];
      var deltaA = labA[1] - labB[1];
      var deltaB = labA[2] - labB[2];

      return Math.sqrt(Math.pow(deltaL, 2) +
                       Math.pow(deltaA, 2) +
                       Math.pow(deltaB, 2));
    }
561288
public function translateX($deltaX)
	{
		foreach ($this->points as $point) {
			$point->translateX($deltaX);
		}
		$this->start->translateX($deltaX);
		return $this;
	}
484429
public function scalar($idx=0)
    {
        $row = $this->row();

        if(is_null($row))

            return NULL;

        $values = is_numeric($idx) ? array_values($row) : $row;

        return $values[$idx];
    }
1292264
public boolean eq(IntDoubleSortedVector other, double delta) {
        // This is slow, but correct.
        IntDoubleSortedVector v1 = IntDoubleSortedVector.getWithNoZeroValues(this, delta);
        IntDoubleSortedVector v2 = IntDoubleSortedVector.getWithNoZeroValues(other, delta);
                
        if (v2.size() != v1.size()) {
            return false;
        }

        for (IntDoubleEntry ve : v1) {
            if (!Primitives.equals(ve.get(), v2.get(ve.index()), delta)) {
                return false;
            }
        }
        for (IntDoubleEntry ve : v2) {
            if (!Primitives.equals(ve.get(), v1.get(ve.index()), delta)) {
                return false;
            }
        }
        return true;
    }
387447
def pan_delta(self, d):
        """"""
        dx, dy = d

        pan_x, pan_y = self.pan
        zoom_x, zoom_y = self._zoom_aspect(self._zoom)

        self.pan = (pan_x + dx / zoom_x, pan_y + dy / zoom_y)
        self.update()