private void innerProduct(Point3d[] coords1, Point3d[] coords2) {
		double x1, x2, y1, y2, z1, z2;
		double g1 = 0.0, g2 = 0.0;

		Sxx = 0;
		Sxy = 0;
		Sxz = 0;
		Syx = 0;
		Syy = 0;
		Syz = 0;
		Szx = 0;
		Szy = 0;
		Szz = 0;

		if (weight != null) {
			wsum = 0;
			for (int i = 0; i < coords1.length; i++) {

				wsum += weight[i];

				x1 = weight[i] * coords1[i].x;
				y1 = weight[i] * coords1[i].y;
				z1 = weight[i] * coords1[i].z;

				g1 += x1 * coords1[i].x + y1 * coords1[i].y + z1 * coords1[i].z;

				x2 = coords2[i].x;
				y2 = coords2[i].y;
				z2 = coords2[i].z;

				g2 += weight[i] * (x2 * x2 + y2 * y2 + z2 * z2);

				Sxx += (x1 * x2);
				Sxy += (x1 * y2);
				Sxz += (x1 * z2);

				Syx += (y1 * x2);
				Syy += (y1 * y2);
				Syz += (y1 * z2);

				Szx += (z1 * x2);
				Szy += (z1 * y2);
				Szz += (z1 * z2);
			}
		} else {
			for (int i = 0; i < coords1.length; i++) {
				g1 += coords1[i].x * coords1[i].x + coords1[i].y * coords1[i].y + coords1[i].z * coords1[i].z;
				g2 += coords2[i].x * coords2[i].x + coords2[i].y * coords2[i].y + coords2[i].z * coords2[i].z;

				Sxx += coords1[i].x * coords2[i].x;
				Sxy += coords1[i].x * coords2[i].y;
				Sxz += coords1[i].x * coords2[i].z;

				Syx += coords1[i].y * coords2[i].x;
				Syy += coords1[i].y * coords2[i].y;
				Syz += coords1[i].y * coords2[i].z;

				Szx += coords1[i].z * coords2[i].x;
				Szy += coords1[i].z * coords2[i].y;
				Szz += coords1[i].z * coords2[i].z;
			}
			wsum = coords1.length;
		}

		e0 = (g1 + g2) * 0.5;
	}
private void innerProduct ( Point3d [ ] coords1 , Point3d [ ] coords2 ) { double x1 , x2 , y1 , y2 , z1 , z2 ; double g1 = 0.0 , g2 = 0.0 ; Sxx = 0 ; Sxy = 0 ; Sxz = 0 ; Syx = 0 ; Syy = 0 ; Syz = 0 ; Szx = 0 ; Szy = 0 ; Szz = 0 ; if ( weight != null ) { wsum = 0 ; for ( int i = 0 ; i < coords1 . length ; i ++ ) { wsum += weight [ i ] ; x1 = weight [ i ] * coords1 [ i ] . x ; y1 = weight [ i ] * coords1 [ i ] . y ; z1 = weight [ i ] * coords1 [ i ] . z ; g1 += x1 * coords1 [ i ] . x + y1 * coords1 [ i ] . y + z1 * coords1 [ i ] . z ; x2 = coords2 [ i ] . x ; y2 = coords2 [ i ] . y ; z2 = coords2 [ i ] . z ; g2 += weight [ i ] * ( x2 * x2 + y2 * y2 + z2 * z2 ) ; Sxx += ( x1 * x2 ) ; Sxy += ( x1 * y2 ) ; Sxz += ( x1 * z2 ) ; Syx += ( y1 * x2 ) ; Syy += ( y1 * y2 ) ; Syz += ( y1 * z2 ) ; Szx += ( z1 * x2 ) ; Szy += ( z1 * y2 ) ; Szz += ( z1 * z2 ) ; } } else { for ( int i = 0 ; i < coords1 . length ; i ++ ) { g1 += coords1 [ i ] . x * coords1 [ i ] . x + coords1 [ i ] . y * coords1 [ i ] . y + coords1 [ i ] . z * coords1 [ i ] . z ; g2 += coords2 [ i ] . x * coords2 [ i ] . x + coords2 [ i ] . y * coords2 [ i ] . y + coords2 [ i ] . z * coords2 [ i ] . z ; Sxx += coords1 [ i ] . x * coords2 [ i ] . x ; Sxy += coords1 [ i ] . x * coords2 [ i ] . y ; Sxz += coords1 [ i ] . x * coords2 [ i ] . z ; Syx += coords1 [ i ] . y * coords2 [ i ] . x ; Syy += coords1 [ i ] . y * coords2 [ i ] . y ; Syz += coords1 [ i ] . y * coords2 [ i ] . z ; Szx += coords1 [ i ] . z * coords2 [ i ] . x ; Szy += coords1 [ i ] . z * coords2 [ i ] . y ; Szz += coords1 [ i ] . z * coords2 [ i ] . z ; } wsum = coords1 . length ; } e0 = ( g1 + g2 ) * 0.5 ; }
Calculates the inner product between two coordinate sets x and y
(optionally weighted, if weights set through
{@link #set(Point3d[], Point3d[], double[])}). It also calculates an
upper bound of the most positive root of the key matrix.
http://theobald.brandeis.edu/qcp/qcprot.c

@param coords1
@param coords2
@return