Question: do not do (a) just do (b) code must be in c++ Give two 3D vectors, v1[3] and v2[3] of float type. Suppose you are

do not do (a) just do (b) code must be in c++
Give two 3D vectors, v1[3] and v2[3] of float type. Suppose you are to write a library of functions that do the following computations. (a) A (C++ or C) function that returns the dot-product of the two vectors with the following function heading: float DotProduct(vec3 v1, vec3 v2); (b) A (C++ or C) function that returns the angle (in degree) between the two vectors with the following function heading: float FindAngle(vec3 v1, vec3 v2); [Hint: There are two definitions for calculating the dot-product: v1 V2 = v1x* v2x + v1y * v2y + v12 * v2z or v1 v2 = |v1||V2|cos(a) where a is the angle between the two vectors.]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
