Write a C++ program to Compute the resultant of two two-dimensional forces. 1) W
ID: 3680006 • Letter: W
Question
Write a C++ program to Compute the resultant of two two-dimensional forces. 1) Write a function to Compute the direction angle of a force F by using a component of the force F_x, F_y or F_x, and the magnitude of the force F as its parameters, return the direction angle in degree. theta = arccos(F_I/F) 2) Write a function to Compute the magnitude F and direction angle of a force F by using three components of the force F_a, F_y and F_z as itsparameters, and returning F and using the reference to pass direction angles alpha, beta gamma values, where the direction angles are calcul ated by calling the function in the step 1. The magnitude: F = F^2_x + F^2_y + F^2_2 The direction angles: alpha = arccos(F_x/F), Beta = arccos(F_z/F), gamma = arccos(F_z/F) 3) Write another function to calculate the resultant of two forces and it s direction angles by using the components of two forces (F_x1, F_y1, F_z1) and (F_x2, F_y2, F_z2) as its parameters, and returning the resultant of two forces R and using the references to pass direction angles alpha, beta and gamma values. The resultant: R = (F_r1 + F_r2)^2 + (F_y1 + F_y2)^2 + (F_z1 + F_z2)^2 The direction angle: alpha = arccos(F_r1 + F_r2/R), beta = arccos(F_y1 + F_y2/R), gamma = arccos(F_21 + F_z2/R) 4) Write a program to ask users to input two forces by their components (F_x1, F_y1, F_z1) and (F_x2, F_y2, F_x2) from the deyboard. Calculate the magnitudes and direction angles, and, the resultant of both forces and its direction angle. Display all the results of both forces and their resultant on the screen.Explanation / Answer
1.void computeangle( double FX,double FY,double FZ,double mass)
{float a=9.8
degree theta;
double F;
F=m*a
theta=cos^-1(FX/F)
cout<<"the angle in degree"<<theta;
}
2.void computemagnitude(double FX,double FY,double FZ,&alpha,&beta,&gamma)
{double F
F=sqrt(FX^2+FY^2+FZ^2)
alpha=cos^-1(FX/F);
beta=cos^-1(FY/F);
gamma=cos^-1(FZ/Z)
cout<<"the magnitude of force "<<F;
cout<<"the angles in degree"<<alpha<<beta<<gamma;
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.