Advertisement
Zalosin

Untitled

Dec 3rd, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. Morris Beardbarian
  2. #include <iostream>
  3. #include <math.h>
  4. using namespace std;
  5. #define PI 3.14159265
  6. int main()
  7. {
  8. double a1x, a1y,a2x,a2y,a3x,a3y,a4x,a4y;
  9. cin>>a1x>> a1y>>a2x>>a2y>>a3x>>a3y>>a4x>>a4y;
  10. double cosinusA4, cosinusA2;
  11. cosinusA2 = ((a1x - a2x)*(a3x - a2x)+(a1y - a2y)*(a3y - a2y))/(sqrt((a1x - a2x)*(a1x - a2x)+(a1y - a2y)*(a1y - a2y))*sqrt((a3x - a2x)*(a3x - a2x)+(a3y - a2y)*(a3y - a2y)));
  12. cosinusA4 = ((a3x - a4x)*(a1x - a4x)+(a3y - a4y)*(a1y - a4y))/(sqrt((a1x - a4x)*(a1x - a4x)+(a1y - a4y)*(a1y - a4y))*sqrt((a3x - a4x)*(a3x - a4x)+(a3y - a4y)*(a3y - a4y)));
  13. double uA2 = acos(cosinusA2) * 180.0 / PI;
  14. double uA4 = acos(cosinusA4) * 180.0 / PI;
  15. if(abs(uA2 + uA4 - 180) < pow(10, -7))
  16. cout<<"A4 e pe cerc";
  17. else
  18. if(uA2 + uA4 > 180)
  19. cout<<"A4 e in int cercului";
  20. else
  21. cout<<"A4 e in ext cercului";
  22. cout<<endl;
  23. if(sqrt((a2x - a1x)*(a2x - a1x)+(a2y - a1y)*(a2y - a1y))+sqrt((a4x - a3x)*(a4x - a3x)+(a4y - a3y)*(a4y - a3y))==
  24. sqrt((a4x - a1x)*(a4x - a1x)+(a4y - a1y)*(a4y - a1y))+sqrt((a3x - a2x)*(a3x - a2x)+(a3y - a2y)*(a3y - a2y)))
  25. cout<<"patrulaterul este circusciptibil";
  26. else
  27. cout<<"patrulaterul nu este circusciptibil";
  28. return 0;
  29. }
  30. Morris Beardbarian
  31. 9:11pm
  32. Morris Beardbarian
  33. Chestia asta este rezolvarea Gabrielei, inca nu m-am uitat nici eu pe ea... dar merge cica si i-a punctat-o profu
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement