Java Vector vector_dot(double[] vec1, double[] vec2)

Here you can find the source of vector_dot(double[] vec1, double[] vec2)

Description

vectodot

License

Apache License

Declaration

public static double vector_dot(double[] vec1, double[] vec2) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static double vector_dot(double[] vec1, double[] vec2) {
        double sum = 0;
        for (int i = 0; i < vec1.length && i < vec2.length; i++)
            sum += vec1[i] * vec2[i];//w  w w . j  a v a  2s .c o m
        return sum;
    }
}

Related

  1. Vector2fMult(float[] a, float[] b, float[] dest)
  2. Vector2fNegate(float[] a, float[] dest)
  3. Vector2fNew()
  4. Vector2fNormalize(float[] a, float[] dest)
  5. vector2string(int[] vector)
  6. vector_norm(double[] vec)
  7. vector_sum(double[] v, double[] w)
  8. vectorAbsoluteValue(double X, double Y, double Z)
  9. vectorCos(int[] d1, int[] d2)