Question: #include #include using namespace std; const double EPSILON ( 1 e - 1 1 ) ; / / function prototypes / / ENTER FUNCTION PROTOTYPE

#include
#include
using namespace std;
const double EPSILON(1e-11);
// function prototypes
// ENTER FUNCTION PROTOTYPE FOR read_vector HERE.
// ENTER FUNCTION PROTOTYPE FOR vec_length HERE.
// ENTER FUNCTION PROTOTYPE FOR dot_product HERE.
// ENTER FUNCTION PROTOTYPE FOR compute_angle HERE.
// ENTER FUNCTION PROTOTYPE FOR radians_to_degrees HERE.
// ENTER FUNCTION PROTOTYPE FOR normalization HERE.
// ENTER FUNCTION PROTOTYPE FOR output_vector HERE.
// ENTER FUNCTION PROTOTYPE FOR resultant_vector HERE
// ENTER FUNCTION PROTOTYPE FOR display_info HERE.
//*** DO NOT CHANGE ANY CODE IN THE MAIN FUNCTION.
int main()
{
double u1, v1; // coordinates of vector 1
double u2, v2; // coordinates of vector 2
double radians; // angle in radians
double degrees; // angle in degrees
read_vector("Enter 1st vector (2 floats): ", u1, v1);
read_vector("Enter 2nd vector (2 floats): ", u2, v2);
// compute angle in radians between (u1, v1) and (u2, v2)
radians = compute_angle(u1, v1, u2, v2);
// convert radians to degrees
degrees = radians_to_degrees(radians);
// output information
display_info(u1, v1, u2, v2, degrees);
cout << endl;
return(0);
}
// DEFINE FUNCTION read_vector HERE.
// DEFINE FUNCTION vec_length HERE.
// DEFINE FUNCTION dot_product HERE.
// DEFINE FUNCTION compute_angle HERE.
// DEFINE FUNCTION radians_to_degrees HERE.
// DEFINE FUNCTION normalization HERE.
// DEFINE FUNCTION output_vector HERE.
// DEFINE FUNCTION resultant_vector HERE
// DEFINE FUNCTION display_info HERE.
Test 5
> run
Enter 1st vector (2 floats): 1.25-0.25
Enter 2nd vector (2 floats): 0.353.14
First vector: (1.25,-0.25) has length 1.27475
Second vector: (0.35,3.14) has length 3.15945
Resultant vector: (1.6,2.89) has length 3.30335
Angle between vectors (1.25,-0.25) and (0.35,3.14)=94.9497 degrees.
The vectors are NOT ORTHOGONAL.
Test 6
> run
Enter 1st vector (2 floats): 0.353.14
Enter 2nd vector (2 floats): 1.25-0.25
First vector: (0.35,3.14) has length 3.15945
Second vector: (1.25,-0.25) has length 1.27475
Resultant vector: (1.6,2.89) has length 3.30335
Angle between vectors (0.35,3.14) and (1.25,-0.25)=94.9497 degrees.
The vectors are NOT ORTHOGONAL.78
Test 7
> run
Enter 1st vector (2 floats): 0.707106781180.70710678118
Enter 2nd vector (2 floats): -0.707106781180.70710678118
First vector: (0.707107,0.707107) has length 1
Second vector: (-0.707107,0.707107) has length 1
Resultant vector: (0,1.41421) has length 1.41421
Angle between vectors (0.707107,0.707107) and (-0.707107,0.707107)=90 degrees.
The vectors are ORTHONORMAL.
Test 8
> run
Enter 1st vector (2 floats): -0.707106781180.70710678118
Enter 2nd vector (2 floats): -0.70710678118-0.70710678118
First vector: (-0.707107,0.707107) has length 1
Second vector: (-0.707107,-0.707107) has length 1
Resultant vector: (-1.41421,0) has length 1.41421
Angle between vectors (-0.707107,0.707107) and (-0.707107,-0.707107)=90 degrees.
The vectors are ORTHONORMAL.
Test 9
> run
Enter 1st vector (2 floats): 0-5
Enter 2nd vector (2 floats): -10
First vector: (0,-5) has length 5
Second vector: (-1,0) has length 1
Resultant vector: (-1,-5) has length 5.09902
Angle between vectors (0,-5) and (-1,0)=90 degrees.
The vectors are ORTHOGONAL, but NOT ORTHONORMAL.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!