{
double lfx = this->cc().lfx();
double lfy = this->cc().lfy();
+ double lrx = this->cc().lrx();
+ double lry = this->cc().lry();
+ double rrx = this->cc().rrx();
+ double rry = this->cc().rry();
double rfx = this->cc().rfx();
double rfy = this->cc().rfy();
- double ccx = this->cc().x();
- double ccy = this->cc().y();
double lfs = sgn(
(lfx - this->ps().x1()) * (this->ps().y4() - this->ps().y1())
- (lfy - this->ps().y1()) * (this->ps().x4() - this->ps().x1())
);
+ double lrs = sgn(
+ (lrx - this->ps().x1()) * (this->ps().y4() - this->ps().y1())
+ - (lry - this->ps().y1()) * (this->ps().x4() - this->ps().x1())
+ );
+ double rrs = sgn(
+ (rrx - this->ps().x1()) * (this->ps().y4() - this->ps().y1())
+ - (rry - this->ps().y1()) * (this->ps().x4() - this->ps().x1())
+ );
double rfs = sgn(
(rfx - this->ps().x1()) * (this->ps().y4() - this->ps().y1())
- (rfy - this->ps().y1()) * (this->ps().x4() - this->ps().x1())
);
- double ccs = sgn(
- (ccx - this->ps().x1()) * (this->ps().y4() - this->ps().y1())
- - (ccy - this->ps().y1()) * (this->ps().x4() - this->ps().x1())
- );
- return lfs == rfs && lfs != ccs;
+ return lfs == rfs && (lfs != lrs || lfs != rrs);
}
// find entry