Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- struct point {
- double x, y;
- };
- double square (point a, point b, point c) {
- b.x -= a.x;
- b.y -= a.y;
- c.x -= a.x;
- c.y -= a.y;
- return abs(b.x * c.y - b.y * c.x) / 2.;
- }
- double dist (point a, point b) {
- return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
- }
- int main()
- {
- cout << fixed << setprecision(9);
- point a, b, c;
- cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y;
- cout << square(a, b, c);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement