直接上代码了
public boolean isInside(Points left,Points top,Points right,Points buttom,Points pointToCheck){
Line line1=Line.getLine(left, top),line2=Line.getLine(top, right),line3=Line.getLine(right, buttom),line4=Line.getLine(buttom, left);
if(Line.getValue(line1, pointToCheck)>=0 && Line.getValue(line2, pointToCheck)>=0&& Line.getValue(line3, pointToCheck)<=0 && Line.getValue(line4, pointToCheck)<=0){
return true;
}else return false;
}
class Points{
public double x;
public double y;
public Points(double x,double y){