Content deleted Content added
Line 416:
Point points[] = { Point(1,1), Point(3,1), Point(2,2), Point(4,2), Point(2,4),Point(4,4),Point(2,5),Point(4,5),Point(3,7),Point(5,7) };
Point q(3,3);
Segment
int stripSize=(sizeof points / sizeof points[0]);
int segmentSize=(sizeof segments / sizeof segments[0]);
Strip *strips=new Strip [stripSize];
Line 465 ⟶ 463:
int indexOfStrip= getIndexOfStrip(strips,q.x,stripSize);
Point target=strips[indexOfStrip].copy->findSmallestLargerOrEqualYCoordinatePoint(strips[indexOfStrip].copy,q.y);
cout<<"Segment above the query point has starting point:";▼
cout<<"There is no segment above the query point q";
}
else
{
▲ cout<<"Segment above the query point q has starting point:";
cout<<target;
for(int i=0;i<segmentSize;i++)
{
if(segments[i].startPoint.x==target.x && segments[i].startPoint.y==target.y)
{
cout<<"and end point:";
cout<<segments[i].endPoint;
break;
}
}
}
delete[] strips;
return 0;
}
</syntaxhighlight>
|