Java Utililty Methods Vector Multiply

List of utility methods to do Vector Multiply

Description

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

Method

double[]vectorMatrixMultiply(double[][] matrix, double[] vector)
vector Matrix Multiply
double[] rotatedVector = new double[3];
for (int i = 0; i < 3; i++) {
    rotatedVector[i] = vector[0] * matrix[i][0] + vector[1] * matrix[i][1] + vector[2] * matrix[i][2];
return rotatedVector;
voidvectorMult(final float[] result, final float[] m, final float[] v)
vector Mult
for (int i = 0; i < result.length; i++) {
    float s = v[0] * m[i];
    int k = i + 4;
    for (int j = 1; j < v.length; j++) {
        s += v[j] * m[k];
        k += 4;
    result[i] = s;
...
voidvectorMult3D(float[] array, int vectorIndex, float scale)
This method multiplies the given 3D vector by the specified scale amount.
int tempIndex = 3 * vectorIndex;
array[tempIndex + 0] *= scale;
array[tempIndex + 1] *= scale;
array[tempIndex + 2] *= scale;
double[]vectorMultiply(double s, double[] v)
Performs scalar multiplication on a vector.
double[] result = new double[v.length];
for (int i = 0; i < result.length; i++) {
    result[i] = s * v[i];
return result;