Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef long double ld;
- struct vect {
- ld x, y;
- vect(): x(0), y(0) {}
- vect(ld x, ld y): x(x), y(y) {}
- vect(vect a, vect b): x(b.x - a.x), y(b.y - a.y) {}
- };
- vect operator+(vect a, vect b) {
- return vect(a.x + b.x, a.y + b.y);
- }
- ld operator*(vect a, vect b) {
- return a.x * b.x + a.y * b.y;
- }
- vect operator*(vect a, ld k) {
- return vect(a.x * k, a.y * k);
- }
- ld operator^(vect a, vect b) {
- return a.x * b.y - b.x * a.y;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement