Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- const long double PI = acos(-1.0);
- using namespace std;
- struct Point
- {
- int x, y;
- Point(int px = 0, int py = 0) : x(px), y(py) {}
- };
- struct Vector
- {
- int x, y;
- Vector(int px = 0, int py = 0) : x(px), y(py) {};
- Vector(Point p1, Point p2) : x(p2.x - p1.x), y(p2.y - p1.y) {}
- };
- istream& operator>> (istream &in, Point & p)
- {
- in >> p.x >> p.y;
- return in;
- }
- ostream& operator<< (ostream& out, const Vector & v)
- {
- out << v.x << " " << v.y;
- return out;
- }
- int dot_product(Vector v1, Vector v2)
- {
- return v1.x * v2.x + v1.y * v2.y;
- }
- int cross_product(Vector v1, Vector v2)
- {
- return v1.x * v1.y - v1.y * v2.x;
- }
- signed main() {
- std::ios::sync_with_stdio(false);
- cin.tie(0);
- freopen("INPUT.TXT", "r", stdin);
- Point A, B, C;
- cin >> A >> B >> C;
- Vector AB(A,B), AC(A,C), BC(B,C);
- cout << AB << endl;
- cout << AC << endl;
- cout << BC << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement