calculate the velocity between two points. unit is in px per ms.
@param {Number} deltaTime
@param {Number} x
@param {Number} y
@return {Object} velocity `x` and `y`
490924
function getVelocity(deltaTime, x, y) {
    return {
        x: x / deltaTime || 0,
        y: y / deltaTime || 0
    };
}
681427
function() {
      // find delta transform points
      var px    = deltaTransformPoint(this, 0, 1)
        , py    = deltaTransformPoint(this, 1, 0)
        , skewX = 180 / Math.PI * Math.atan2(px.y, px.x) - 90

      return {
        // translation
        x:        this.e
      , y:        this.f
      , transformedX:(this.e * Math.cos(skewX * Math.PI / 180) + this.f * Math.sin(skewX * Math.PI / 180)) / Math.sqrt(this.a * this.a + this.b * this.b)
      , transformedY:(this.f * Math.cos(skewX * Math.PI / 180) + this.e * Math.sin(-skewX * Math.PI / 180)) / Math.sqrt(this.c * this.c + this.d * this.d)
        // skew
      , skewX:    -skewX
      , skewY:    180 / Math.PI * Math.atan2(py.y, py.x)
        // scale
      , scaleX:   Math.sqrt(this.a * this.a + this.b * this.b)
      , scaleY:   Math.sqrt(this.c * this.c + this.d * this.d)
        // rotation
      , rotation: skewX
      , a: this.a
      , b: this.b
      , c: this.c
      , d: this.d
      , e: this.e
      , f: this.f
      , matrix: new SVG.Matrix(this)
      }
    }
532680
public double Function2D(double x, double y) {
        return Math.exp(-(x * x + y * y) / (2 * sqrSigma)) / (2 * Math.PI * sqrSigma);
    }
613175
function (deltaTime, on, channel, note, velocity) {
  var status = on ? 0x90 : 0x80;

  status += channel;
  deltaTime = makeVLQ(deltaTime);

  return Buffer.concat([deltaTime, new Buffer([status, note, velocity])]);
}
669808
function processDisplacement(pointers) {
    var delta = processDelta(pointers),
        dx = delta.dx,
        dy = delta.dy,
        velx = delta.velx = Math.abs(dx) / delta.dts,
        vely = delta.vely = Math.abs(dy) / delta.dts,
        direction = delta.direction = getDirection(dx, dy);

    delta.distance = getDistance(dx, dy, direction);
    delta.velocity = getOverallVelocity(velx, vely, direction);
        
    return delta;
}
1135686
function forward$10(p) {
        var gfi, u, deltav, s, d, eps, ro;
        var lon = p.x;
        var lat = p.y;
        var delta_lon = adjust_lon(lon - this.long0);
        /* Transformation */
        gfi = Math.pow(((1 + this.e * Math.sin(lat)) / (1 - this.e * Math.sin(lat))), (this.alfa * this.e / 2));
        u = 2 * (Math.atan(this.k * Math.pow(Math.tan(lat / 2 + this.s45), this.alfa) / gfi) - this.s45);
        deltav = -delta_lon * this.alfa;
        s = Math.asin(Math.cos(this.ad) * Math.sin(u) + Math.sin(this.ad) * Math.cos(u) * Math.cos(deltav));
        d = Math.asin(Math.cos(u) * Math.sin(deltav) / Math.cos(s));
        eps = this.n * d;
        ro = this.ro0 * Math.pow(Math.tan(this.s0 / 2 + this.s45), this.n) / Math.pow(Math.tan(s / 2 + this.s45), this.n);
        p.y = ro * Math.cos(eps) / 1;
        p.x = ro * Math.sin(eps) / 1;

        if (!this.czech) {
            p.y *= -1;
            p.x *= -1;
        }
        return (p);
    }
492433
function getDirection(x, y) {
  if (x === y) {
    return DIRECTION_NONE;
  }

  if (abs(x) >= abs(y)) {
    return x > 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
  }
  return y > 0 ? DIRECTION_UP : DIRECTION_DOWN;
}
1155113
public double Function2D(double x, double y) {
        double frequency = initFrequency;
        double amplitude = initAmplitude;
        double sum = 0;

        // octaves
        for (int i = 0; i < octaves; i++) {
            sum += SmoothedNoise(x * frequency, y * frequency) * amplitude;

            frequency *= 2;
            amplitude *= persistence;
        }
        return sum;
    }
983403
def ystep(self):
        
        """

        self.Y = sp.prox_l1(self.AX - self.S + self.U, self.Wdf / self.rho)
27748
function(deltaTime){

            var currentTime = new Date().getTime();
            deltaTime = deltaTime || currentTime-this.lastUpdated;

            //Ignore minor updates
            if (deltaTime < 5){
                return this;
            }

            deltaTime /= 1000; //convert to seconds

            //Calculate deltas based on how much time has passed since last update
            var data = this.attributes;

            if (data.isAccelerating){

                var deltaVelocity = this.ACCELERATION * deltaTime;
                var deltaTime1 = 0;

                //Calculate new velocities
                var newVelocityX = data.velocityX + (Math.cos(data.angle) * deltaVelocity);
                var newVelocityY = data.velocityY + (Math.sin(data.angle) * deltaVelocity);

                //If velocities exceed maximums, we have to do some additional logic to calculate new positions
                if (newVelocityX > this.MAX_VELOCITY_X || newVelocityX < -this.MAX_VELOCITY_X){
                    newVelocityX = (newVelocityX > 0) ? this.MAX_VELOCITY_X : -this.MAX_VELOCITY_X;

                    deltaTime1 = getTime(data.velocityX, newVelocityX, this.ACCELERATION);
                    data.posX += getDistance(data.velocityX, newVelocityX, deltaTime1) + (newVelocityX*(deltaTime-deltaTime1));
                }
                else{
                    data.posX += getDistance(data.velocityX, newVelocityX, deltaTime);
                }

                if (newVelocityY > this.MAX_VELOCITY_Y || newVelocityY < -this.MAX_VELOCITY_Y){
                    newVelocityY = (newVelocityY > 0) ? this.MAX_VELOCITY_Y : -this.MAX_VELOCITY_Y;

                    deltaTime1 = getTime(data.velocityY, newVelocityY, this.ACCELERATION);
                    data.posY += getDistance(data.velocityY, newVelocityY, deltaTime1) + (newVelocityY*(deltaTime-deltaTime1));
                }else{
                    data.posY += getDistance(data.velocityY, newVelocityY, deltaTime);
                }

                data.velocityX = newVelocityX;
                data.velocityY = newVelocityY;
            }
            else{
                data.posX +=  data.velocityX * deltaTime;
                data.posY +=  data.velocityY * deltaTime;
            }

            //Check to see if player has exceeded zone boundary, in which case send them to opposite side
            var radius = this.SIZE/2;
            var maxPosX =  Constants.Zone.WIDTH+radius;
            var maxPosY =  Constants.Zone.HEIGHT+radius;

            while (data.posX > maxPosX) data.posX -= maxPosX+radius;
            while (data.posX < -radius) data.posX += maxPosX+radius;

            while (data.posY > maxPosY) data.posY -= maxPosY+radius;
            while (data.posY < -radius) data.posY += maxPosY+radius;

            //Update last updated timestamp
            this.lastUpdated = currentTime;

            return this;
        }
367426
function (x, y) {
		return x >= this.minX && x <= this.maxX && y >= this.minY && y <= this.maxY;
	}
853269
function(elem, props, delta, vector) {
          var v = vector.scale(-delta);  
          if(v.norm() < 1) {
              var x = v.x, y = v.y;
              var ans = elem.startPos
                .getc().moebiusTransformation(v);
              elem.pos.setc(ans.x, ans.y);
              v.x = x; v.y = y;
            }           
        }
697355
def get_movement_delta(self):
        """"""
        pos = self.pan - self.previous_pos
        self.previous_pos = Vector2(self.pan.X, self.pan.Y)
        return pos
995228
function fpsToPoint(index, fps_val, min, delta) {
            return [
                canvas_w - index,
                canvas_h - canvas_h * (fps_val - min) / delta
            ];
        }
1227160
public static double integral(DoubleUnaryOperator f, double x1, double x2, int points)
    {
        double delta = (x2-x1)/points;
        double delta2 = delta/2.0;
        double sum = 0;
        double y1 = f.applyAsDouble(x1);
        double y2;
        for (int ii=1;ii<=points;ii++)
        {
            x1 += delta;
            y2 = f.applyAsDouble(x1);
            sum += (y1+y2)*delta2;
            y1 = y2;
        }
        return sum;
    }
908398
public static double getGradDotDirApprox(Function fn, IntDoubleVector x, IntDoubleVector d) {
        return getGradDotDirApprox(fn, x, d, getEpsilon(x, d));
    }
578263
public static double calcLoad(Long deltaCpuTime, long deltaUptime, long factor) {
		if (deltaCpuTime == null || deltaCpuTime <= 0 || deltaUptime == 0) {
			return 0.0;
		}
		return deltaCpuTime * 100d / factor / deltaUptime;
	}