Добавлена функция проверки принадлежности точки к окружности

This commit is contained in:
Victor 2013-10-04 17:18:11 +03:00
parent a04ea1b272
commit 857973a51e

View File

@ -1,13 +1,21 @@
package tse.lr2;
import java.awt.Point;
/**
*
* @author aNNiMON
*/
public class Circle extends Ellipse {
public boolean isConsist() {
return false;
public boolean isConsist(Point point) {
Point center = getCenterPoint();
int radius = center.x - points[0].x;
double tmp = Math.pow(point.x - center.x, 2);
tmp += Math.pow(point.y - center.y, 2);
return (tmp <= (radius * radius));
}
@Override