Java Utililty Methods Vector Product

List of utility methods to do Vector Product

Description

The list of methods to do Vector Product are organized into topic(s).

Method

double[]vector_product(double[] v, double[] w)
vectoproduct
assert (v.length == w.length);
double[] r = new double[v.length];
for (int i = 0; i < v.length; i++)
    r[i] = v[i] * w[i];
return r;
doublevectorDotProduct(double X1, double Y1, double Z1, double X2, double Y2, double Z2)
vector Dot Product
double dorProduct = X1 * X2 + Y1 * Y2 + Z1 * Z2;
return dorProduct;
doublevectorDotProduct(double[] v1, double[] v2)
vector Dot Product
if (v1.length != v2.length)
    return 0;
double sum = 0;
for (int i = 0; i < v1.length; i++)
    sum += v1[i] * v2[i];
return sum;
double[][]vectorProduct(double[] x, boolean isColumnVectorX, double[] y, boolean isColumnVectorY)
vector Product
double[][] xx = null;
double[][] yy = null;
int i;
if (isColumnVectorX) {
    xx = new double[x.length][1];
    for (i = 0; i < x.length; i++)
        xx[i][0] = x[i];
} else {
...
float[]vectorProduct(float[] x, float[] y)
vector Product
float[] res = new float[3];
res[0] = x[1] * y[2] - x[2] * y[1];
res[1] = x[2] * y[0] - x[0] * y[2];
res[2] = x[0] * y[1] - x[1] * y[0];
return res;