Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <math.h>
- using namespace std;
- int main() {
- float x=10,y=10,z=4,c;
- float l0 = 10,l1=10,l2=10;
- float theta1, theta2, theta3;
- float interno = l1-l2;
- float externo = l1+l2;
- float r = sqrt(x*x + y*y);
- float tg1, tg2;
- if(r>externo) {
- cout<<"coordenada além do limite ext";
- }
- if(r<interno){
- cout<<"coordenada além do limite int";
- }
- if (r>= interno && r<= externo){
- theta1 = acos(x/r) - acos((x*x + y*y + l1*l1 - l2*l2)/(2*l1*r));
- theta2 = M_PI- acos((l1*l1 + l2*l2 - (x*x + y*y))/(2*l1*l2));
- c= z - l0;
- tg1 = theta1*180/M_PI;
- tg2 = theta2*180/M_PI;
- cout<<"\t\t\tRADIANS";
- cout<<"\n\n\ntheta1 em radianos = "<< theta1;
- cout<<"\ntheta2 em radianos = "<<theta2;
- cout<<"\n\n\t\t\tDEG";
- cout<<"\n\ntheta1 em graus = "<<tg1;
- cout<<"\ntheta2 em graus = "<<tg2;
- cout<<"\n\nC";
- cout<<"\nc= "<<c;
- }
- }
Add Comment
Please, Sign In to add comment