Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Morris Beardbarian
- #include <iostream>
- #include <math.h>
- using namespace std;
- #define PI 3.14159265
- int main()
- {
- double a1x, a1y,a2x,a2y,a3x,a3y,a4x,a4y;
- cin>>a1x>> a1y>>a2x>>a2y>>a3x>>a3y>>a4x>>a4y;
- double cosinusA4, cosinusA2;
- 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)));
- 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)));
- double uA2 = acos(cosinusA2) * 180.0 / PI;
- double uA4 = acos(cosinusA4) * 180.0 / PI;
- if(abs(uA2 + uA4 - 180) < pow(10, -7))
- cout<<"A4 e pe cerc";
- else
- if(uA2 + uA4 > 180)
- cout<<"A4 e in int cercului";
- else
- cout<<"A4 e in ext cercului";
- cout<<endl;
- if(sqrt((a2x - a1x)*(a2x - a1x)+(a2y - a1y)*(a2y - a1y))+sqrt((a4x - a3x)*(a4x - a3x)+(a4y - a3y)*(a4y - a3y))==
- sqrt((a4x - a1x)*(a4x - a1x)+(a4y - a1y)*(a4y - a1y))+sqrt((a3x - a2x)*(a3x - a2x)+(a3y - a2y)*(a3y - a2y)))
- cout<<"patrulaterul este circusciptibil";
- else
- cout<<"patrulaterul nu este circusciptibil";
- return 0;
- }
- Morris Beardbarian
- 9:11pm
- Morris Beardbarian
- 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