Скачиваний:
63
Добавлен:
09.05.2014
Размер:
1.2 Кб
Скачать
package lab1;

public class LinerQuarter extends CoordinateQuarter {
private double tngXY;
private double C;
private double xLeft;
private double xRight;
private double yBottom;
private double yTop;
private Boolean growup;

public LinerQuarter(byte quarter, double tng, double free, double xMin,
double xMax, double yMin, double yMax, Boolean grow) {
super(quarter);
this.tngXY = tng;
this.C = free;
this.xLeft = xMin;
this.xRight = xMax;
this.yBottom = yMin;
this.yTop = yMax;
this.growup = grow;
}

protected Boolean IsBelongs(Coordinate point) {
if ((this.xLeft <= point.GetX()) &&
(this.xRight >= point.GetX()) &&
(this.yBottom <= point.GetY()) &&
(this.yTop >= point.GetY())) {
if (this.growup.booleanValue())
return Boolean.valueOf((this.tngXY*point.GetX() + this.C) <= point.GetY());
else
return Boolean.valueOf((this.tngXY*point.GetX() + this.C) >= point.GetY());
}
else
return Boolean.FALSE;
}
}
Соседние файлы в папке lab1