aboutsummaryrefslogtreecommitdiff
path: root/09_geometry/point_location_test_2189.cpp
blob: 998abb8df0e79100f46b42fac4691204cb587272 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <iostream>

struct Point {
	long long x;
	long long y;
	Point operator-(const Point& p) const { return Point{x-p.x, y-p.y}; }
	long long operator*(const Point& v) { return x * v.y - y * v.x; }
};

int main() {
	int t;
	Point a, b, c;
	std::cin >> t;
	for (int i = 0; i < t; i++) {
		std::cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y;
		auto v = (b-a)*(c-a);
		if (v > 0) std::cout << "LEFT\n";
		else if (v < 0) std::cout << "RIGHT\n";
		else std::cout << "TOUCH\n";
	}
}

Generated with cgit - Back to sebastiano.tronto.net