Three forces act on a point: 3N at 0°, 4N at 90°, and 5N at 217°. What is the net force? What fourth force will put the point in equilibrium? in C++

C++
x
20
#include <iostream>
#include <cmath>
using namespace std;
int main() {
double x1 = 3 * cos(0);
double y1 = 3 * sin(0);
double x2 = 4 * cos(90);
double y2 = 4 * sin(90);
double x3 = 5 * cos(217);
double y3 = 5 * sin(217);
cout << "The net force is: " << sqrt((x1 + x2 + x3) * (x1 + x2 + x3) + (y1 + y2 + y3) * (y1 + y2 + y3)) << endl;
cout << "The fourth force is: " << sqrt((-x1 - x2 - x3) * (-x1 - x2 - x3) + (-y1 - y2 - y3) * (-y1 - y2 - y3)) << endl;
return 0;
}
🤖 Code Explanation

More problems solved in C++



















