double dot_product (const doubleu[],const double v[],const int SIZE); The functi
ID: 3613228 • Letter: D
Question
double dot_product (const doubleu[],const double v[],const int SIZE);
The functionangle()will call the functiondot_product().The definition of this function will be likethis:
double angle (const double u[], constdouble v[], const int SIZE ){
double normu, normv, dotuv;
dotuv = dot_product ( u, v, SIZE );
normu = sqrt ( dot_product(u, u, SIZE));
normv = sqrt ( dot_product(v, v, SIZE));
doubleangle;
angle = acos ( dotuv / (normu * normv));
returnangle;
}
The math functionacoscomputes cos-1.
You need to implementthe function dot_product().
double ( const double u[], const doublev[], const int SIZE ){
...
}