题目
按照斜率来比对,把一些特殊情况再分离出来
class Solution {
public boolean isBoomerang(int[][] points) {
int y2 = points[2][1]-points[0][1];
int x2 = points[2][0]-points[0][0];
int y1 = points[1][1]-points[0][1];
int x1 = points[1][0]-points[0][0];
if((points[2][1]==points[1][1]&&points[2][0]==points[1][0])||
(points[2][1]==points[0][1]&&points[2][0]==points[0][0])||
(points[1][1]==points[0][1]&&points[1][0]==points[0][0])) return false;
if(x1==0 && x2==0) return false;
if(x1==0 || x2==0) return true;
return !((y2/(double)x2)==(y1/(double)x1));
}
}