Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- struct Point
- {
- long double x, y;
- };
- long double dist(Point a, Point b)
- {
- return sqrt((((b.x - a.x)*(b.x - a.x)) + ((b.y - a.y)*(b.y - a.y))));
- }
- long double calculateA(Point a, Point b)
- {
- if(b.x - a.x == 0) return 0;
- else
- {
- return (b.y - a.y) / (b.x - a.x);
- }
- }
- int main()
- {
- ios_base::sync_with_stdio(0);
- Point a,b,c,d;
- long double aDist, bDist, cDist, dDist;
- long double alfa, beta, gamma, delta;
- long double wspA, wspB, wspC, wspD;
- cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y >> d.x >> d.y;
- aDist = dist(a,b);
- bDist = dist(b,c);
- cDist = dist(c,d);
- dDist = dist(d,a);
- //cout << aDist << " " << bDist << " " << cDist << " " << dDist << endl;
- if(aDist + cDist == bDist + dDist) cout << "True" << endl;
- else cout << "False" << endl;
- if(round((dist(a,c) * dist(b,d))) == round((aDist * cDist) + (bDist *dDist ))) cout << "True" << endl;
- else cout << "False" << endl;
- // cout << dist(a,c) << " " << dist(b,d);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement