Page 94 - DCAP313_LAB_ON_COMPUTER_GRAPHICS
P. 94
Lab on Computer Graphics
Notes Figure 5.6: When only one intersection point exists, the ellipses must be tangent at the
intersection point. As with the case of zero intersection points, either one
ellipse is fully contained within the other, or the ellipse areas are disjoint.
The algorithm for finding overlap area in the case of zero intersection points
can also be used when there is a single intersection point.
3 3
2 2
1 1
0 0
-4 -3 -2 -1 0 1 2 3 4 -4 -3 -2 -1 0 1 2 3 4
-1 -1
-2 3 -2
Case 1-1 Case 1-2
-3 2 -3
1
0
-4 -3 -2 -1 0 1 2 3 4
-1
-2
Case 1-3
-3
Figure 5.7: When two intersection points exist, either both of the points are tangents,
or the ellipse curves cross at both points. For two tangent points, one ellipse
must be fully contained within the other. For two crossing points, a partial
overlap must exist.
Each sub-case for two intersection points requires a different overlap-area calculation. When
there are two intersection points, if one point is a tangent, then both points must be tangents.
And, if one point is not a tangent, then neither point is a tangent. It suffices to check one of the
intersection points for tangency. Suppose the ellipses are tangent at an intersection point; then,
points that lie along the first ellipse on either side of the intersection will lie in the same region of
the second ellipse (inside or outside). That is, if two points are chosen that lie on the first ellipse,
one on each side of the intersection, then both points will either be inside the second ellipse, or
88 LOVELY PROFESSIONAL UNIVERSITY