티스토리 뷰
public static boolean contains(Rectangle r, Point p)
{
// TODO - you need to implement this. May want to use isInBetween
return p.x >= r.x && p.y >= r.y && p.x <= r.x + r.width && p.y < =r.y + r.height;
}
또는 주석에서 언급했듯이 IsBetween을 사용할 수 있습니다.
public static boolean contains(Rectangle r, Point p)
{
return Assignment6.isBetween(p.x,r.x,r.x+r.width) && Assignment6.isBetween(p.y,r.y,r.y+r.height);
}
출처
https://stackoverflow.com/questions/39940157
댓글