原题链接
叉乘结果为0,说明共线,否则说明不共线
三个向量的叉乘太麻烦了,换成两个计算
class Solution {
public:
bool isBoomerang(vector>& points) {
int x1 = points[0][0], y1 = points[0][1];
int x2 = points[1][0], y2 = points[1][1];
int x3 = points[2][0], y3 = points[2][1];
int a = x2 - x1, b = y2 - y1;
int c = x3 - x1, d = y3 - y1;
if(a * d - b * c == 0) return false;
return true;
}
};



