Graphics Reference
In-Depth Information
c D 0 D 1
c 0
c 1
r 1
r 0
Figure 1.16. Finding area and center of intersection of disks.
The geometric center of intersection (if intersection exists) is given by
c 0) r 0
+0 . 5 .
r 1
2 c 0 − c 1
c D 0 D 1 = c 0+( c 1
(1.22)
Both equations (1.21) and (1.22) simplify under the assumption that c 0isat
(0 , 0) .
In the case of a rectangle-disk intersection, we treat the disk as a square
adjusted to have the same area as the original disk. Therefore, we can resort
to simple axis-aligned rectangle-rectangle intersection mathematics. A R 0 R 1 and
c R 0 R 1 are given by
tl =max c 0
,
d 0
2 ,c 1
d 1
2
br =min c 0+ d 0
,
(1.23)
2 ,c 1+ d 1
2
A R 0 R 1 =max( tl.x
br.x, 0)max( tl.y
br.y, 0) ,
c R 0 R 1 = tl + br
2
,
where c 0, d 0, c 1, and d 1 are the center points and dimensions of rectangles R 0
and R 1, respectively, and tl and br are top left and bottom right intersection
corners, respectively (assuming Euclidian space with inverse y ; see Figure 1.17).
It is worth noting that accurate results can only be achieved for models based
on radially symmetrical PDFs. If we strip away the projection part, by substi-
tuting the projected ellipse with a disk during our intersection tests and further
Search WWH ::




Custom Search