The center of the Gaussian resulting from the product of two Gaussians:
    >>> gaussian_product_center(1,array((0,0,0),'d'),1,array((0,0,0),'d'))
    array([ 0.,  0.,  0.])
350448
def gaussian_product_center(alpha1,A,alpha2,B):
    
    return (alpha1*A+alpha2*B)/(alpha1+alpha2)
906032
def angle(self, center1_x, center1_y, center2_x, center2_y):
        
        phi_G = np.arctan2(center2_y - center1_y, center2_x - center1_x)
        return phi_G
1226488
def gaussian(self, x, p):
        
        y = (1.0 / (p[1] * np.sqrt(2 * np.pi)) *
             np.exp(-(x - p[0]) ** 2 / (2 * p[1] ** 2))) * p[2]
        return y
970610
def cross_product (x1, y1, x2, y2, x3, y3):
    
    return (x2 - x1) * (y3 - y1) - (x3 - x1) * (y2 - y1)
512107
def centerOfMass(self):
        
        cmf = vtk.vtkCenterOfMass()
        cmf.SetInputData(self.polydata(True))
        cmf.Update()
        c = cmf.GetCenter()
        return np.array(c)
216091
def _get_centered_ztor(self, rup, Frv):
        
        if Frv == 1:

            mean_ztor = max(2.704 - 1.226 * max(rup.mag - 5.849, 0.0), 0.) ** 2
            centered_ztor = rup.ztor - mean_ztor
        else:

            mean_ztor = max(2.673 - 1.136 * max(rup.mag - 4.970, 0.0), 0.) ** 2
            centered_ztor = rup.ztor - mean_ztor

        return centered_ztor
992713
def gaussian(x,  a, b, c, d=0):
    '''
    
    '''
    return a * np.exp(  -(((x-b)**2 )/ (2*(c**2)))  ) + d
696016
function ccw(c) {
    var n = c.length
    var area = [0]
    for(var j=0; j<n; ++j) {
      var a = positions[c[j]]
      var b = positions[c[(j+1)%n]]
      var t00 = twoProduct(-a[0], a[1])
      var t01 = twoProduct(-a[0], b[1])
      var t10 = twoProduct( b[0], a[1])
      var t11 = twoProduct( b[0], b[1])
      area = robustSum(area, robustSum(robustSum(t00, t01), robustSum(t10, t11)))
    }
    return area[area.length-1] > 0
  }
415181
def gaussian_kernel(sigma, truncate=4.0):
    

    sigma = float(sigma)
    radius = int(truncate * sigma + 0.5)

    x, y = np.mgrid[-radius:radius + 1, -radius:radius + 1]
    sigma = sigma ** 2

    k = 2 * np.exp(-0.5 * (x ** 2 + y ** 2) / sigma)
    k = k / np.sum(k)

    return k
213506
def _calc_distortion(self):
        
        m = self._X.shape[0]
        self.distortion = 1/m * sum(
            linalg.norm(self._X[i, :] - self.centroids[self.clusters[i]])**2 for i in range(m)
        )
        return self.distortion
880909
function Gaussian(parms) {
      if (parms == null) {
        parms = {};
      }
      if (parms.pi !== void 0) {
        this.pi = parms["pi"];
        this.tau = parms["tau"];
      } else if (parms.mu !== void 0) {
        this.pi = pow(parms["sigma"], -2);
        this.tau = this.pi * parms["mu"];
      } else {
        this.pi = 0;
        this.tau = 0;
      }
      if (isNaN(this.pi) || isNaN(this.tau)) {
        throw new Error("Gaussian parms can not be NaN");
      }
    }
246146
def hessian(self, x, y, amp, sigma, center_x=0, center_y=0):
        
        x_ = x - center_x
        y_ = y - center_y
        r = np.sqrt(x_**2 + y_**2)
        sigma_x, sigma_y = sigma, sigma
        if isinstance(r, int) or isinstance(r, float):
            r = max(r, self.ds)
        else:
            r[r <= self.ds] = self.ds
        d_alpha_dr = -self.d_alpha_dr(r, amp, sigma_x, sigma_y)
        alpha = self.alpha_abs(r, amp, sigma)

        f_xx = -(d_alpha_dr/r + alpha/r**2) * x_**2/r + alpha/r
        f_yy = -(d_alpha_dr/r + alpha/r**2) * y_**2/r + alpha/r
        f_xy = -(d_alpha_dr/r + alpha/r**2) * x_*y_/r
        return f_xx, f_yy, f_xy
98007
def center(self, weights=None):
        
        if weights is None:
            weights = self.data.weights
        mass = utils.bincount(self.labels, weights, self.N)
        cp = numpy.empty((len(mass), self.data.pos.shape[-1]), 'f8')
        for d in range(self.data.pos.shape[-1]):
            cp[..., d] = utils.bincount(self.labels, weights *
                    self.data.pos[..., d], self.N)
            cp[..., d] /= mass
        return cp
961324
def com(self, center1_x, center1_y, center2_x, center2_y, Fm):
        
        com_x = (Fm * center1_x + center2_x)/(Fm + 1.)
        com_y = (Fm * center1_y + center2_y)/(Fm + 1.)
        return com_x, com_y
818955
def hilbert_schmidt_inner_product(m1: np.ndarray, m2: np.ndarray) -> complex:
    
    return np.einsum('ij,ij', m1.conj(), m2)
586172
def center(self):
        ''''''
        points = np.array(self._points)
        return np.mean(points[:, COLS.XYZ], axis=0)
1137480
def get_component_product(self, other):
        """"""
        return Point(self.x * other.x, self.y * other.y)