#include
typedef struct{ int x, y; } direction;
int visible(direction s, direction A, direction B, direction C)
{
direction p1, p2;
int d;
p1.x = B.x - A.x; // -1
p1.y = B.y - A.y; // -1
p2.x = C.x - A.x; // 1
// 下面这行是不是应该p2.y
p1.y = C.y - A.y; // 0
// 1 * -1 * 1 + 1 * -1 * undefined
d = s.x * p1.x * p2.x + s.y * p1.y * p2.y;
printf("M\n", d);
return d>0;
}
void main()
{
char *ss[] = { "invisible", "visible" };
direction s = { 1, 1 }, T = { 1, 1 }, A = { 0, 0 }, B = { 2, 1 };
puts(ss[visible(s, T, A, B)]);
}
这个结果是什么