<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Computing the Region Areas of Euler Diagrams Drawn with Three Ellipses</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Luana Micallef</string-name>
          <email>L.Micallef@kent.ac.uk</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Peter Rodgers</string-name>
          <email>P.J.Rodgers@kent.ac.uk</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>School of Computing, University of Kent</institution>
          ,
          <country country="UK">UK</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Ellipses generate accurate area-proportional Euler diagrams for more data than is possible with circles. However, computing the region areas is di cult as ellipses have various degrees of freedom. Numerical methods could be used, but approximation errors are introduced. Current analytic methods are limited to computing the area of only two overlapping ellipses, but area-proportional Euler diagrams in diverse application areas often have three curves. This paper provides an overview of di erent methods that could be used to compute the region areas of Euler diagrams drawn with ellipses. We also detail two novel analytic algorithms to instantaneously compute the exact region areas of three general overlapping ellipses. One of the algorithms decomposes the region of interest into ellipse segments, while the other uses integral calculus. Both methods perform equally well with respect to accuracy and time.</p>
      </abstract>
      <kwd-group>
        <kwd>Euler diagram</kwd>
        <kwd>Venn diagram</kwd>
        <kwd>ellipses</kwd>
        <kwd>area</kwd>
        <kwd>area-proportional</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Area-proportional Euler diagrams are used in various areas, such as genetics [24]
and information search [8], to represent both the set relations (by the intersecting
closed curves) and their cardinalities (by the area of the regions) [5]. Often these
diagrams are drawn for data with two or three sets and are Venn diagrams, like
those in Fig. 1, such that all the possible curve intersections are depicted [28].</p>
      <p>Euler diagrams drawn with circles facilitate user comprehension due to their
smoothness, symmetry and good continuation that make the curves easily
distinguishable even at intersections [3]. Most area-proportional Euler diagrams are
thus drawn with circles [28]. However, circles have limited degrees of freedom
(i.e., a centre and a radius) and draw accurate diagrams for any data with two
sets [5] but not three [6]. Polygons are more exible and draw accurate diagrams
for any 3-set data [6], but their non-smooth curves impede comprehension [2].</p>
      <p>Ellipses have more degrees of freedom (i.e., a centre, a semi-minor axis, a
semi-major axis, and an angle of rotation) than circles, but like circles are
symmetric and smooth. Their helpful features have been long noted [5], but due to
di culties in computing the region areas of the diagram, a drawing method that
uses ellipses (known as eulerAPE) was only recently devised [19].</p>
      <p>Approximate methods could be used to compute the region areas of Euler
diagrams. However, these methods introduce error [15] that could distort the
diagram and thus violate Tufte's graphical integrity principle that \representation
of numbers, as physically measured on the surface of the graphic itself, should
be directly proportional to the numerical quantities represented" [27]. Though
humans are biased to area judgement [7], such accuracy and integrity is still
important. Firstly, it is still unclear how areas in such diagrams are perceived and
what inaccuracies are not noticeable. Secondly, it is highly unlikely for an area
to be perceived in a same way by di erent individuals [18]. Tufte emphasized
that \graphical excellence begins with telling the truth about the data" [27] and
for this reason, he highly criticized metrics that scale objects (e.g., on maps [21])
based on how they could be perceived.</p>
      <p>Analytic methods can compute the exact region areas of Euler diagrams, but
none of the current methods are appropriate for three general ellipses.
Drawing methods for area-proportional Euler diagrams use optimization search
techniques [6] and so, analytic methods that compute the region areas should be
computationally e cient to allow for the generation of accurate diagrams in a
time that maintains user's attention.</p>
      <p>In this paper, we discuss current methods to compute the region areas of
Euler diagrams with ellipses (Section 3) and we describe our two novel
analytic methods to instantaneously (in 10 milliseconds) compute the region
areas of Euler diagrams with three general ellipses (Section 4). Using one of our
analytic methods, eulerAPE (http://www.eulerdiagrams.org/eulerAPE) [19]
draws accurate area-proportional Venn diagrams with ellipses for a large
majority of random 3-set data (86%, N =10,000) in a relatively fast time (97% of the
diagrams within 1 second). The two analytic methods for computing the region
areas of three intersecting ellipses have not been previously detailed. Hence, this
forms the research contribution of this paper.</p>
      <p>We start by introducing basic concepts and de nitions in relation to ellipses.</p>
    </sec>
    <sec id="sec-2">
      <title>Basic Concepts and De nitions</title>
      <p>
        An ellipse is a simple closed curve characterized by (Fig. 2A): a centre, (
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        );
two semi-axes, and , where ≥ ; an angle of rotation, , where 0 ≤ &lt; 2 .
Since ≥ , and are respectively referred to as the semi-major axis and
semi-minor axis. An ellipse is in canonical form if (
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ) = (0,0) and = 0, so
that in the Cartesian coordinate system the ellipse is centred on the origin and
the ellipse's semi-axes are along the x-axis and y-axis, as shown in Fig. 2B. An
ellipse with any (
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ) and is a general ellipse.
An ellipse arc ( ) is a connected portion of the ellipse curve (e.g., ⌢M N in
⌢
Fig. 3A). An ellipse sector (Â) is the space bounded by an ellipse arc and two
line segments between the ellipse's centre and the arc's endpoints (e.g., ÂMNO
in Fig. 3B). The area of an ellipse sector can be de ned using (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) as
1 '2 2d' =
2 '∫1
2 2 '2
2
∫
'1
      </p>
      <p>
        d'
2cos2' +
(
        <xref ref-type="bibr" rid="ref1">1</xref>
        )
(
        <xref ref-type="bibr" rid="ref2">2</xref>
        )
(
        <xref ref-type="bibr" rid="ref3">3</xref>
        )
      </p>
      <p>
        C
The value returned by (
        <xref ref-type="bibr" rid="ref3">3</xref>
        ) is the area of the ellipse sector from '1 to '2 in
an anticlockwise direction along the ellipse curve. Thus, to compute the area of
ÂMNO in Fig. 3B using (
        <xref ref-type="bibr" rid="ref3">3</xref>
        ), '1 and '2 should respectively be the polar angles of
M and N from , which in this case is along the x -axis, with respect to (
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ),
which in this case is (0,0) or O. If instead, '1 and '2 are respectively the polar
angles of N and M from with respect to O, the area computed by (
        <xref ref-type="bibr" rid="ref3">3</xref>
        ) is the
area of the ellipse minus the area of ÂMNO.
      </p>
      <p>
        An ellipse segment (−⌢) is the space bounded by an ellipse arc and a chord
that share the same endpoints (e.g., −⌢MN in Fig. 3C). An ellipse sector (ÂMNO )
is composed of an ellipse segment (−⌢MN ) with the same ellipse arc as the sector
and a triangle (△MNO ). Thus, the area of an ellipse segment can be de ned as
Area of ⌢MN = Area of ÂMNO − Area of △ MNO :
−
(
        <xref ref-type="bibr" rid="ref4">4</xref>
        )
The area of ÂMNO in (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ) is (
        <xref ref-type="bibr" rid="ref3">3</xref>
        ) for the same arc endpoints as that of ⌢MN.
−
      </p>
      <p>
        The polar coordinates representation of an ellipse curve in (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) assumes that
(
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ) is at the pole and is along the polar axis of the coordinate system. So
(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) cannot represent a general ellipse.
      </p>
      <p>
        The curve of a general ellipse can be de ned parametrically as
x(t) = 1 +
y(t) = 2 +
cos cos t −
sin cos t +
sin sin t
cos sin t
where t is the parameter and 0 ≤ t ≤ 2 and (x(t); y(t))
are the Cartesian coordinates of a point on the ellipse curve :
(
        <xref ref-type="bibr" rid="ref5">5</xref>
        )
      </p>
      <p>
        In (
        <xref ref-type="bibr" rid="ref5">5</xref>
        ), t is the angular parameter that determines the position of a particle
moving along the ellipse curve, so that every value of t determines the Cartesian
coordinates (x (t ), y (t )) of a point on the ellipse curve. As shown in Fig. 4, given
a point (x, y ) on the ellipse curve, the corresponding value of t is determined
by drawing a line perpendicular to that passes through (x, y ) and intersects
with the auxiliary circle (i.e., a circle with radius and centre (
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ) that is
the circumscribed circle of the ellipse; in red in Fig. 4) at a point P, and by then
computing the anticlockwise angle from to the line passing through (
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        )
and P with respect to (
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ). The latter angle is the value of t. Since in Fig. 4,
= 0 and point (x, y ) is on the top right quarter of the ellipse curve, the value
of t for (x, y ) can be computed using any one of the following
t = cos−1  x − 1 
or t = sin−1  y − 2  :
(
        <xref ref-type="bibr" rid="ref6">6</xref>
        )
If = 0 and the point (x, y ) is on any other quarter of the ellipse curve, the
equations in (
        <xref ref-type="bibr" rid="ref6">6</xref>
        ) have to be adapted. For instance, if (x, y ) is on the upper left
quarter of the ellipse curve, t is minus the value of t in (
        <xref ref-type="bibr" rid="ref6">6</xref>
        ). If ≠ 0, the point
(x, y ) has to be rotated by - about (
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ) before an equation of t in (
        <xref ref-type="bibr" rid="ref6">6</xref>
        ) or
adaptations of them can be used.
t
      </p>
      <p>P
(x,y)</p>
      <p>
        Alternatively, the curve of a general ellipse can be de ned by the set of points
(x, y ) on the Cartesian plane that satisfy the implicit polynomial equation
((x − 1) cos
+ (y − 2) sin )
2
2
+
((y − 2) cos
− (x − 1) sin )
2
2
= 1 :
(
        <xref ref-type="bibr" rid="ref7">7</xref>
        )
This is more complex to handle compared with the parametric representation in
(
        <xref ref-type="bibr" rid="ref5">5</xref>
        ) and the implicit polynomial equation that should be satis ed by the set of
points (x, y ) that de ne the curve of an ellipse in canonical form, that is
x2 y2
2 + 2 = 1 :
(
        <xref ref-type="bibr" rid="ref8">8</xref>
        )
      </p>
      <p>We now discuss available methods, after which we introduce our novel
analytic methods.</p>
    </sec>
    <sec id="sec-3">
      <title>Available Methods</title>
      <p>3.1</p>
      <sec id="sec-3-1">
        <title>Approximate Methods</title>
        <p>A numerical quadrature method can be used to compute the region areas of any
number of intersecting curves irrespective of their shape. The drawing method
venneuler [28] uses this method to draw area-proportional Euler diagrams with
circles. In venneuler, each circle is drawn on a 200 × 200 pixel plane and each
pixel on each plane is set to 1 if it is in the circle or 0 if not. The area of each
region in the diagram is the sum of the value of all the pixels on all the planes
that are located in that region.</p>
        <p>Such numerical approximation introduce errors in the calculation of the
region areas, as shown in Fig. 5 for an Euler diagram drawn with ellipses. In Fig. 5A
and Fig. 5B, the same diagram is drawn on two identical 200 × 200 grids with a
di erence in the placement of the diagrams on the grids. The magni ed views
of regions ab, ac, bc and abc indicate that according to Fig. 5A there are 0 grid
squares or pixels that are only in region bc, while according to Fig. 5B there are
3. Similar di erences can be noted for the other regions due to a di erence in the
positioning of the diagrams on the grids. Using a larger grid and thinner outlines
for the curves could reduce inaccuracies, but such issues will still be inevitable.
Also, small regions (e.g., region bc in Fig. 5) could be considered missing even
though they are depicted. This could impede the drawing method from handling
diagrams with small regions and impede its optimization process from taking
a path that could lead to an improved solution. If, like venneuler, the drawing
method uses a steepest descent optimization approach, the analytic gradient
cannot be computed and the generated diagram is less likely to be accurate.</p>
        <p>
          Checking whether a point is in a closed curve could be computationally
complex and expensive. With circles, venneuler takes the Cartesian coordinates of
the pixel's location on the plane and applies them to the implicit polynomial
equation of the circle to verify whether the distance between the circle's centre
and the pixel is less than the circle's radius. If the latter is true, the pixel is in
the circle. However, checking if such a pixel is in a general ellipse and conducting
this check for all the pixels on all the planes is computationally expensive, as
ellipses have more degrees of freedom than circles and the implicit polynomial
equation of the curve of a general ellipse (
          <xref ref-type="bibr" rid="ref7">7</xref>
          ) is more complex. If instead, the
implicit polynomial equation of the curve of an ellipse in canonical form (
          <xref ref-type="bibr" rid="ref8">8</xref>
          ) is used,
both the ellipse and the pixel would have to be translated and rotated before
this simpler equation is used. Alternatively, a secant line passing through the
ellipse's centre and the pixel to be checked could be drawn, and the intersection
points of this line with the ellipse could be computed. If the distance between the
ellipse's centre and the intersection point that has the same polar angle (from
about (
          <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
          )) as that of the pixel is greater than the distance between the
ellipse's centre and the pixel, then the pixel is in the ellipse. However, all of these
methods are more computationally expensive than those for circles.
        </p>
        <p>Alternatively, the ellipses could be represented using regular convex polygons
and a standard polygon intersection algorithm could be used to compute the
region areas. For instance, the drawing method VennMaster computes the region
areas of its Euler diagrams with polygons by applying the Gaussian
integration theorem [17]. However, the region areas are not computed accurately and
small regions are often considered missing. The polygons should have
numerous vertices and small edges otherwise the curves would be highly non-smooth,
leading to unreliable approximations of the region areas. Polygon intersection
algorithms for polygons with numerous vertices are also more computationally
expensive than the numerical quadrature method [25].</p>
        <p>Monte Carlo methods could also be used to approximate the region areas,
but due to repeated random sampling, they could be computationally expensive.
3.2</p>
      </sec>
      <sec id="sec-3-2">
        <title>Analytic Methods</title>
        <p>Analytic methods to compute the region areas of two [4] or three [5] intersecting
circles are available. For more circles, approximation methods are often used. For
ellipses, only two analytic methods are available: one by Eberly [9] and another
by Hughes and Chraibi [14].</p>
        <p>Both methods are restricted to two ellipses. Eberly's method is further
restricted to ellipses in canonical form. Hughes and Chraibi's method can handle
any two general ellipses with any centre and angle of rotation. Both methods
compute the area of the overlapping region by rst obtaining the area of the two
ellipse segments making up the region (as shown later in Fig. 6B). The area of
each ellipse segment is obtained by computing the area of an ellipse sector and
then subtracting the area of a triangle, as discussed in Section 2. The derivation
of the area of a sector of an ellipse in canonical form is obtained using integral
calculus. The representation of the ellipse curve is de ned in polar coordinates
by Eberly and parametrically by Hughes and Chraibi. To handle general
ellipses, Hughes and Chraibi rst translate and rotate the general ellipses so they
are transformed into canonical form, and then compute the area of the required
ellipse segment using the same equation as that of ellipses in canonical form.</p>
        <p>Though an analytic method might seem computationally expensive due to
the various degrees of freedom of ellipses, Hughes and Chraibi's method has been
e cient enough to compute the area of two overlapping ellipses for simulations
of dynamic systems, such as an orbiting satellite with a solar calibrator [16].</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Our Analytic Methods</title>
      <p>We devised two general analytic methods for three ellipses, both of which can
handle ellipses that are not necessarily in canonical form. These include:
M1. Decomposition into ellipse segments;</p>
      <p>M2. Using integral calculus.</p>
      <p>These methods di er in the way they compute the area of the overlapping region
between two ellipses and that of an ellipse segment. Similar to Eberly's [9] and
Hughes and Chraibi's [14] methods, M1 decomposes the region of interest into
ellipse segments and uses an equation of the segment area of an ellipse in
canonical form. M2 uses integral calculus to directly derive the equation of the required
enclosed region area without the need of any geometric transformations. M1 and
M2 are discussed later.</p>
      <p>The general algorithm for computing the region areas of three intersecting
ellipses in a Venn diagram using either M1 or M2 is as follows:
Algorithm 1: ComputeRegionAreasOfThreeIntersectingEllipses (d)
Input: A Venn diagram d with three ellipses.</p>
      <p>
        Output: regionAreas, a set of areas one for every region in d.
1. for each ellipse e in d do
2. ellipseAreas [e] ← area of e by (
        <xref ref-type="bibr" rid="ref1">1</xref>
        )
3. end for
4. for each pair of ellipses e1 and e2 in d do
5. points[e1,e2] ← intersection points of e1 and e2 by Hill's method [13]
6. overlapAreas [e1,e2] ← area of the overlapping region between e1 and e2
by M1 or M2 and points[e1,e2]
7. interiorPoints [e1,e2] ← the intersection point in points[e1,e2] that
is inside the third ellipse of d
8. end for
9. Decompose the region in all three ellipses of d into ellipse segments es1, es2,
es3 and triangle ts (as in Fig. 6D) using interiorPoints, which de nes the
arc endpoints of es1, es2, es3 and the vertices of t
10. regionAreas [e1,e2,e3] ← ∑ areas of es1, es2, es3 by (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ) and ts
11. for each pair of ellipses e1 and e2 in d do
12. regionAreas [e1,e2] ← overlapAreas [e1,e2] − regionAreas [e1,e2,e3],
where e3 is the other ellipse in d
13. end for
14. for each ellipse e in d do
15. otherAreas ← ∑ regionAreas [e,e1], regionAreas [e,e2], regionAreas [e,e1,e2],
where e1 and e2 are the two other ellipses in d
16. regionAreas [e] ← ellipseAreas [e] − otherAreas
17. end for
18. return regionAreas
      </p>
      <p>Algorithm 1 has been implemented for both M1 and M2 and for any possible
representation of a Venn diagram with three ellipses that are not necessarily in
canonical form and that intersect pairwise exactly twice. M1 and M2 as well as
the chosen method to compute the intersection points of the ellipses are discussed
in the next sections.</p>
      <p>
        If the general intersecting ellipses do not always intersect each other exactly
twice, an extended version of Algorithm 1 would have to be implemented, so that
the various ways in which the ellipses can intersect would be handled (there can
be from zero up to four intersection points between two ellipses [9]). The method
we have chosen to compute the intersection points [13] returns all the intersection
points (i.e., zero up to four) between any two general ellipses. So the algorithm
can easily be extended by: (i) identifying the way each pair of ellipses intersect
from the number of intersection points between the two ellipses; (ii) decomposing
the relevant regions into ellipse segments and basic geometry shapes like triangles
or rectangles whenever necessary; (iii) using either M1 or M2 to nd the area of
the overlapping region between two ellipses and the area of ellipse segments; (iv)
using (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) to compute the area of the ellipses; (v) using basic algebra to add and
subtract areas wherever necessary to calculate the region areas. In such cases, a
region in the diagram could be made up of multiple connected components and
so, its area would be the sum of the area of all of these components.
To compute the area of the overlapping region of two general ellipses, M1
decomposes the region into two ellipse segments, as in Fig. 6B. As explained in
Algorithm 1 and Fig. 6D, the region in all three ellipses is similarly decomposed
into ellipse segments and a triangle.
      </p>
      <p>Equations de ning the area of a segment of an ellipse in canonical form
can easily be derived and could be less complex than the ones for a general
ellipse. Such equations are already available. For example, Eberly [9] and Hughes
and Chraibi [14] provide two di erent equations based on the area of a sector
of an ellipse in canonical form. Eberly's equation uses the polar coordinates
representation of the ellipse curve, while that of Hughes and Chraibi uses the
parametric representation of the ellipse curve.</p>
      <p>
        M1 uses (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ) to compute the area of an ellipse segment which, similar to
Eberly's equation, uses the polar coordinates representation of the ellipse curve
in (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ). As shown in Fig. 6B and Fig. 6D, the arc endpoints of an ellipse segment
are two of the intersection points of the three overlapping ellipses, which de ne
the arc in an anticlockwise direction along the ellipse curve (the importance of
this direction is explained in Section 2 in relation to (
        <xref ref-type="bibr" rid="ref3">3</xref>
        )). The arc endpoints and
the ellipse are rotated by an angle of - about (
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ) and translated to (0,0), so
that the transformed ellipse is in canonical form. Rotation and translation are
a ne transformations and so, the ellipse's properties, its area and the area of
the required ellipse segment are preserved. The polar angle of each transformed
endpoint from with respect to (0,0) is then computed, and together with
the transformed ellipse, these polar angles are used to compute the area of the
required ellipse segment using (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ).
4.2
      </p>
      <sec id="sec-4-1">
        <title>M2: Using Integral Calculus</title>
        <p>M2 derives an equation of the area of the required enclosed region from de nite
integrals that compute the area under an ellipse curve (or line) between two
given points. The equation of the curve of a general ellipse is used and so, M2
does not require any of the geometric transformations used in M1 to get the
ellipse in canonical form.</p>
        <p>
          Let e1 and e2 be two ellipses that intersect at points i1 and i2, such that the
overlapping region is enclosed by an ellipse arc from i1 and i2 in an anticlockwise
direction along e1 and an ellipse arc from i1 and i2 in an anticlockwise direction
along e2. In M2, the area of the overlapping region between e1 and e2 is
Area under curve e1 from i1 to i2 + Area under curve e2 from i2 to i1 :
(
          <xref ref-type="bibr" rid="ref9">9</xref>
          )
This is illustrated in Fig. 6C for ellipses a and b in Fig. 6A, where a and b are
respectively e1 and e2 in (
          <xref ref-type="bibr" rid="ref9">9</xref>
          ), and iab1 and iab2 are respectively i1 and i2 in (
          <xref ref-type="bibr" rid="ref9">9</xref>
          ).
        </p>
        <p>To compute the area of the region located in all three ellipses, M2 decomposes
the region into ellipse segments and a triangle, as in M1 and as shown in Fig. 6D,
where the arc endpoints of the ellipse segments and the vertices of the triangle
are de ned by the intersection points of the three overlapping ellipses. Given a
segment of an ellipse e with an arc from i1 and i2 in an anticlockwise direction
along e and a secant line l intersecting e at i1 and i2, M2 de nes the area of the
ellipse segment as</p>
        <p>
          Area under curve e from i1 to i2 + Area under line l from i2 to i1 :
(
          <xref ref-type="bibr" rid="ref10">10</xref>
          )
This is illustrated in Fig. 6E for the segment of ellipse a between iac2 and iab2
that is located in all three ellipses of Fig. 6A, where a is e in (
          <xref ref-type="bibr" rid="ref9">9</xref>
          ) and iac2 and
iab2 are respectively i1 and i2 in (
          <xref ref-type="bibr" rid="ref9">9</xref>
          ).
        </p>
        <p>
          The area under a curve between two given points is de ned by a de nite
integral. The curve of a general ellipse can be de ned in di erent ways (Section 2).
However, it is not always so straightforward to handle some representations. For
instance, the implicit polynomial in (
          <xref ref-type="bibr" rid="ref7">7</xref>
          ) has to be converted to an explicit
polynomial before it can be used to nd the area under an ellipse curve. The parametric
representation in (
          <xref ref-type="bibr" rid="ref5">5</xref>
          ) can be used as is and determining the antiderivative of this
representation is straightforward. So M2 uses the parametric representation of
the curve of the general ellipse in (
          <xref ref-type="bibr" rid="ref5">5</xref>
          ), that is x(t) and y(t), and de nes the area
under the curve of a general ellipse e from (x1, y1) to (x2, y2) on e as follows:
        </p>
        <p>If y = F (x) is the explicit de nition of e as a function of x and x(t1)= x1 and
x(t2)= x2, the area under the curve e from (x1, y1) to (x2, y2) is
sin cos t +
cos sin t) (− cos sin t −
sin cos t) dt =
x2 t2 t2
∫ F (x)dx = ∫ F (x(t))x′(t)dt = ∫ y(t)x′(t)dt =
x1 t1 t1
t2
t∫1 ( 2 +
K1 sin 2t + K2 sin t + K3 cos 2t + K4 cos t + K5t]tt12</p>
        <p>cos 2
where K1 = 4 ; K2 = − 2 sin ;</p>
        <p>K3 =</p>
        <p>K4 = 2 cos ; K5 = − 2 :
Else (i.e., Sx1 − x2S ≤ Sy1 − y2S)</p>
        <p>If x = F (y) is the explicit de nition of e as a function of y and y(t1)= y1 and
y(t2)= y2, the area under the curve e from (x1, 1) to (x2, y2) is

2
+ 2 sin 2
8
;</p>
        <p>
          (
          <xref ref-type="bibr" rid="ref11">11</xref>
          )

2
+ 2 sin 2
8
;
(
          <xref ref-type="bibr" rid="ref12">12</xref>
          )
y2 t2 t2
y∫1 F (y)dy =t∫1 F (y(t))y′(t)dt = t∫1 x(t)y′(t)dt =
t2
t∫1 ( 1 +
K1 sin 2t + K2 sin t + K3 cos 2t + K4 cos t + K5t]tt12
        </p>
        <p>cos 2
where K1 = 4 ; K2 = 1 cos ;</p>
        <p>K3 =
K4 = 1 sin ; K5 = 2 :
cos cos t −
sin sin t) (− sin sin t +</p>
        <p>
          cos cos t) dt =
The value of t1 and t2 corresponding to (x1, y1) and (x2, y2) respectively is
computed as discussed in Section 2 in relation to (
          <xref ref-type="bibr" rid="ref5">5</xref>
          ) and (
          <xref ref-type="bibr" rid="ref6">6</xref>
          ).
        </p>
        <p>Similarly, the area under a line l from (x1, y1) to (x2, y2) on l where m and
c are respectively the gradient and y-intercept of l is de ned as:
Else (i.e., Sx1 − x2S ≤ Sy1 − y2S)</p>
        <p>If x = ym− c explicitly de nes l as a function of y, the area under l from
(x1, y1) to (x2, y2) is</p>
        <p>y2</p>
        <p>However, to compute the region area of the overlapping ellipses, the
intersection points of the ellipses are required.</p>
      </sec>
      <sec id="sec-4-2">
        <title>Computing the Intersection Points of the Ellipses</title>
        <p>All the intersection points of the ellipses in a diagram can be obtained by
computing the intersection points of every ellipse pair.</p>
        <p>An ellipse is a curve and so, the various methods of computing the intersection
points of two curves [11, 25] can be adapted for the intersection points of two
ellipses. Numerical methods, such as Bezier and internal subdivision [29], Bezier
clipping [26] and the Newton-Raphson method, could also be used. However,
as explained earlier, numerical approximation methods introduce error and can
distort the diagram.</p>
        <p>The most common analytic methods include: (i) the resultant-based method
using for instance Bezout's resultant [9, 10]; (ii) the Grobner basis method [11];
(iii) the matrix-based method [13]. These methods have been used for various
areas (e.g., the resultant-based method [14]; the Grobner basis method [23]; the
matrix-based method [1]).</p>
        <p>Methods (i) and (ii) are more complex than (iii) as the roots of a quartic
polynomial have to be solved using Ferrari's solution or other methods [12]. For
example, Hughes and Chraibi's [14] analytic method for the region areas of two
intersecting ellipses uses a numerical implementation of Ferrari's solution [22] to
nd the roots of the quartic polynomial. However, we only require the real roots
and so, nding all the roots of a quartic polynomial is a waste of computational
resources [12].</p>
        <p>Using the matrix representation of conic sections and homogeneous
transformation matrices, method (iii) can compute the intersection points of the two
ellipses without referring to any quartic polynomials. This method has now been
extended to e ciently identify whether two solid ellipsoid intersect [1]. Thus, for
our analytic methods, we use Hill's method [13] to compute the ellipses'
intersection points.
5</p>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>Evaluation of Our Methods</title>
      <p>M1, M2 and an approximate method were used to compute the region areas of
8000 Venn diagrams with three ellipses whose properties were randomly
generated and which intersect exactly twice pairwise. Some of these randomly
generated diagrams had very small region areas that are barely visible like regions c
and bc in Fig. 1B. The computed areas were then compared. The approximate
method represented the ellipses as regular convex polygons and used a standard
polygon intersection algorithm to nd the area of the regions and to compute
the intersection points.</p>
      <p>The same areas were obtained by our analytic methods, M1 and M2 (with
an occasional insigni cant di erence of less than 10−4). The average percentage
error of the areas provided by the approximate method with respect to any one
of our analytic methods was 1.04%. M1 and M2 returned the same area for
small regions like those in Fig. 1B, but the approximate method disregarded
these regions as if they were missing and the represented set relations were
nonexistent.</p>
      <p>M1 and M2 computed the areas in around 10 milliseconds on an Intel Core
i7 CPU @2GHz with 8GB RAM, OS X 10.8.4 and Java Platform 1.6.0 51. This
response time is 10 times less than the 0.1 second limit for an instantaneous
response [20], and similar to that of numerical methods (e.g., venneuler's [28]
response time is 1 millisecond using a numerical quadrature method on a
MacBook Pro @2.5Ghz with 2GB RAM and Java Platform 1.5). Thus, our analytic
methods can also be used for any other application, including simulations of
dynamic systems, where both accuracy and e ciency is important.
6</p>
    </sec>
    <sec id="sec-6">
      <title>Conclusion</title>
      <p>We have discussed methods to compute the region areas of Euler diagrams drawn
with ellipses. We rst reviewed current available methods, namely approximate
and analytic methods, and we then described our two novel analytic methods to
compute the region areas of three general intersecting ellipses.</p>
      <p>Methods that automatically draw area-proportional Euler diagrams with
three curves require a mechanism to compute the region areas of diagrams in
relatively fast time. A recent drawing method eulerAPE [19] demonstrated the
bene ts of ellipses in drawing such diagrams accurately and with smooth curves.
However, the region areas must rst be computed accurately and an analytic
method is thus required. Current analytic methods are restricted to two ellipses
and so our methods are the rst to calculate region areas for three ellipses.
One method decomposes the regions into ellipse segments and the other uses
integral calculus, but both return accurate region areas instantaneously (in 10
milliseconds), even when the diagram has very small regions as in Fig. 1B.</p>
      <p>We implemented Algorithm 1 that measures the region areas of Venn
diagrams with three curves and ellipses that intersect exactly twice pairwise. We
describe how to handle other Euler diagrams with three curves, but this extended
version is not yet implemented.</p>
      <p>The regions of an Euler diagram with any number of ellipses can be
decomposed into ellipse segments and possibly a polygon (e.g., a triangle or a
quadrilateral). The area of the overlapping region between two ellipses and that
of an ellipse segment can be computed with our methods, while the area of an
ellipse and that of a polygon can be computed using standard geometry
formula. Thus, our methods can easily be extended to instantaneously compute
the region areas of Euler diagrams with any number of ellipses. Methods that
draw area-proportional Euler diagrams with more than three ellipses can then
be devised.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>Salvatore</given-names>
            <surname>Alfano</surname>
          </string-name>
          and Meredith L Greer.
          <article-title>Determining If Two Solid Ellipsoids Intersect</article-title>
          .
          <source>Journal of Guidance</source>
          , Control, and Dynamics,
          <volume>26</volume>
          (
          <issue>1</issue>
          ):
          <volume>106</volume>
          {
          <fpage>110</fpage>
          ,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>F</given-names>
            <surname>Benoy</surname>
          </string-name>
          and
          <string-name>
            <given-names>P</given-names>
            <surname>Rodgers</surname>
          </string-name>
          .
          <article-title>Evaluating the comprehension of Euler diagrams</article-title>
          .
          <source>Proceedings of the 11th International Conference on Information Visualization (IV)</source>
          , pages
          <fpage>771</fpage>
          {
          <fpage>780</fpage>
          ,
          <year>2007</year>
          . IEEE.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>A</given-names>
            <surname>Blake</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G</given-names>
            <surname>Stapleton</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P</given-names>
            <surname>Rodgers</surname>
          </string-name>
          , L Cheek, and
          <string-name>
            <given-names>J</given-names>
            <surname>Howse</surname>
          </string-name>
          .
          <article-title>The impact of shape on the perception of euler diagrams</article-title>
          .
          <source>Proceedings of the 8th International Conference on the Diagrammatic Representation and Inference (Diagrams), Lecture Notes in Arti cial Intelligence</source>
          <volume>8578</volume>
          , pages
          <fpage>123</fpage>
          {
          <fpage>137</fpage>
          ,
          <year>2014</year>
          . Springer.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>S</given-names>
            <surname>Chow</surname>
          </string-name>
          and
          <string-name>
            <given-names>P</given-names>
            <surname>Rodgers</surname>
          </string-name>
          .
          <article-title>Constructing area-proportional Venn and Euler diagrams with three circles</article-title>
          .
          <source>Proceedings of the 2nd International Workshop on Euler Diagrams</source>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>S</given-names>
            <surname>Chow</surname>
          </string-name>
          and
          <string-name>
            <given-names>F</given-names>
            <surname>Ruskey. Drawing Area-Proportional Venn</surname>
          </string-name>
          and
          <string-name>
            <given-names>Euler</given-names>
            <surname>Diagrams</surname>
          </string-name>
          .
          <source>Proceedings of the 11th International Symposium on Graph Drawing (GD 2003), Lecture Notes in Computer Science</source>
          <volume>2912</volume>
          , pages
          <fpage>466</fpage>
          {
          <fpage>477</fpage>
          ,
          <year>2004</year>
          . Springer.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>Stirling</given-names>
            <surname>Christopher</surname>
          </string-name>
          <article-title>Chow. Generating and Drawing Area-Proportional Venn and Euler Diagrams</article-title>
          .
          <source>PhD thesis</source>
          , University of Victoria, Victoria,
          <string-name>
            <surname>BC</surname>
          </string-name>
          , Canada,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>William</surname>
            <given-names>S Cleveland.</given-names>
          </string-name>
          <article-title>The Elements of Graphing Data, Revised Edition</article-title>
          . Hobart Press, Summit, NJ, USA,
          <year>1994</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>Tuan</given-names>
            <surname>Dang</surname>
          </string-name>
          , Anushka Anand, and Leland Wilkinson.
          <source>FmFinder: Search and Filter Your Favorite Songs. Advances in Visual Computing, Lecture Notes in Computer Science</source>
          ,
          <volume>7431</volume>
          :
          <fpage>348</fpage>
          {
          <fpage>358</fpage>
          ,
          <year>2012</year>
          . Springer.
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>D</given-names>
            <surname>Eberly</surname>
          </string-name>
          .
          <article-title>The Area of Intersecting Ellipses</article-title>
          . http://www.geometrictools.com/ Documentation/AreaIntersectingEllipses.pdf,
          <year>2010</year>
          . Geometric Tools, LLC.
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <given-names>D</given-names>
            <surname>Eberly</surname>
          </string-name>
          . Intersection of Ellipses. http://www.geometrictools.com/ Documentation/IntersectionOfEllipses.pdf,
          <year>2011</year>
          . Geometric Tools, LLC.
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Gerald E Farin</surname>
          </string-name>
          , Josef Hoschek, and
          <string-name>
            <surname>Myung-Soo Kim</surname>
          </string-name>
          . Handbook of Computer Aided Geometric Design.
          <source>Elsevier</source>
          (North-Holland), Amsterdam, The Netherlands,
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Don</surname>
          </string-name>
          Herbison-Evans.
          <article-title>Solving Quartics and Cubics for Graphics</article-title>
          . In Alan W Paeth, editor, Graphics Gems V, pages
          <volume>3</volume>
          {
          <fpage>15</fpage>
          . Morgan Kaufmann, USA,
          <year>1995</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Kenneth</surname>
          </string-name>
          J Hill.
          <article-title>Matrix-based Ellipse Geometry</article-title>
          . In Alan W Paeth, editor, Graphics Gems V, pages
          <volume>72</volume>
          {
          <fpage>77</fpage>
          . Morgan Kaufmann, USA,
          <year>1995</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <given-names>GB</given-names>
            <surname>Hughes</surname>
          </string-name>
          and
          <string-name>
            <given-names>M</given-names>
            <surname>Chraibi. Calculating Ellipse</surname>
          </string-name>
          Overlap Area. http://works. bepress.com/gbhughes/17,
          <year>2011</year>
          . arXiv:
          <volume>1106</volume>
          .3787 [physics.comp-ph].
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <given-names>Eugene</given-names>
            <surname>Isaacson</surname>
          </string-name>
          .
          <article-title>Analysis of numerical methods</article-title>
          .
          <source>Courier Dover Publications</source>
          , Mineola,
          <string-name>
            <surname>NY</surname>
          </string-name>
          , USA,
          <year>1994</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <given-names>S</given-names>
            <surname>Kent</surname>
          </string-name>
          , ME Kaiser, SE Deustua,
          <string-name>
            <given-names>J</given-names>
            <surname>Smith</surname>
          </string-name>
          , and et al.
          <article-title>Photometric calibrations for 21st century science</article-title>
          .
          <source>2009. arXiv:0903.2799v1 [astro-ph.CO].</source>
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>Hans</surname>
            <given-names>A Kestler</given-names>
          </string-name>
          , Andr Mller, Johann M Kraus, Malte Buchholz, Thomas M Gress, Hongfang Liu, David W Kane, Barry R Zeeberg,
          <string-name>
            <surname>and John N Weinstein.</surname>
          </string-name>
          <article-title>VennMaster: Area-proportional Euler diagrams for functional GO analysis of microarrays</article-title>
          .
          <source>BMC Bioinformatics</source>
          ,
          <volume>9</volume>
          :
          <fpage>67</fpage>
          ,
          <year>2008</year>
          . BioMed Central Ltd.
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <surname>Hans-Joachim Meihoefer</surname>
          </string-name>
          .
          <article-title>The visual perception of the circle in thematic maps/experimental results</article-title>
          .
          <source>Cartographica: The International Journal for Geographic Information and Geovisualization</source>
          ,
          <volume>10</volume>
          (
          <issue>1</issue>
          ):
          <volume>63</volume>
          {
          <fpage>84</fpage>
          ,
          <year>1973</year>
          . UT Press.
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19.
          <string-name>
            <given-names>Luana</given-names>
            <surname>Micallef</surname>
          </string-name>
          and
          <string-name>
            <given-names>Peter</given-names>
            <surname>Rodgers</surname>
          </string-name>
          . eulerAPE: Drawing Area-Proportional 3
          <article-title>-Venn Diagrams using ellipses</article-title>
          .
          <source>PLoS ONE</source>
          ,
          <volume>9</volume>
          (
          <issue>7</issue>
          ):e101717,
          <year>2014</year>
          . Public Library of Science. http://www.eulerdiagrams.org/eulerAPE.
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          20.
          <string-name>
            <given-names>RB</given-names>
            <surname>Miller</surname>
          </string-name>
          .
          <article-title>Response time in man-computer conversational transactions</article-title>
          .
          <source>Proceedings of the December 9-11</source>
          ,
          <year>1968</year>
          (
          <article-title>AFIPS) fall joint computer conference</article-title>
          , part I, pages
          <volume>267</volume>
          {
          <fpage>277</fpage>
          ,
          <year>1968</year>
          . ACM.
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          21. Daniel R Montello.
          <source>Cognitive Map-Design Research in the Twentieth Century: Theoretical and Empirical Approaches. Cartography and Geographic Information Science</source>
          ,
          <volume>29</volume>
          (
          <issue>3</issue>
          ):
          <volume>283</volume>
          {
          <fpage>304</fpage>
          ,
          <year>2002</year>
          . Cartography and Geographic Information Society.
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          22.
          <string-name>
            <surname>Terence RF</surname>
          </string-name>
          <article-title>Nonweiler</article-title>
          .
          <article-title>Algorithm 326: Roots of low-order polynomial equations</article-title>
          .
          <source>Communications of the ACM</source>
          ,
          <volume>11</volume>
          (
          <issue>4</issue>
          ):
          <volume>269</volume>
          {
          <fpage>270</fpage>
          ,
          <year>1968</year>
          . ACM.
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          23.
          <string-name>
            <given-names>Federico</given-names>
            <surname>Pernici</surname>
          </string-name>
          .
          <article-title>Two Results in Computer Vision using Projective Geometry</article-title>
          .
          <source>PhD thesis</source>
          , University of Florence, Florence, Italy,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          24.
          <string-name>
            <surname>Christian</surname>
            <given-names>RA Regenbrecht</given-names>
          </string-name>
          , Marc Jung, Hans Lehrach, and
          <string-name>
            <given-names>James</given-names>
            <surname>Adjaye</surname>
          </string-name>
          .
          <article-title>The molecular basis of genistein-induced mitotic arrest and exit of self-renewal in embryonal carcinoma and primary cancer cell lines</article-title>
          .
          <source>BMC Medical Genomics</source>
          ,
          <volume>1</volume>
          :
          <fpage>49</fpage>
          ,
          <year>2008</year>
          . BioMed Central Ltd.
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          25.
          <string-name>
            <given-names>Philip</given-names>
            <surname>Schneider</surname>
          </string-name>
          and
          <string-name>
            <surname>David H Eberly</surname>
          </string-name>
          .
          <article-title>Geometric tools for computer graphics</article-title>
          . Morgan Kaufmann, San Francisco, CA, USA,
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref26">
        <mixed-citation>
          26. Thomas W Sederberg and
          <string-name>
            <given-names>Tomoyuki</given-names>
            <surname>Nishita</surname>
          </string-name>
          .
          <article-title>Curve intersection using Bezier clipping</article-title>
          .
          <source>Computer-Aided Design</source>
          ,
          <volume>22</volume>
          (
          <issue>9</issue>
          ):
          <volume>538</volume>
          {
          <fpage>549</fpage>
          ,
          <year>1990</year>
          . Elsevier.
        </mixed-citation>
      </ref>
      <ref id="ref27">
        <mixed-citation>
          27. Edward Rolf Tufte.
          <source>The Visual Display of Quantitative Information, 1st Edition</source>
          . Graphics Press, Cheshire,
          <string-name>
            <surname>CT</surname>
          </string-name>
          , USA,
          <year>1983</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref28">
        <mixed-citation>
          28.
          <string-name>
            <given-names>Leland</given-names>
            <surname>Wilkinson</surname>
          </string-name>
          .
          <article-title>Exact and approximate area-proportional circular Venn and Euler diagrams</article-title>
          .
          <source>IEEE Transactions on Visualization and Computer Graphics</source>
          ,
          <volume>18</volume>
          (
          <issue>2</issue>
          ):
          <volume>321</volume>
          {
          <fpage>331</fpage>
          ,
          <year>2012</year>
          . IEEE.
        </mixed-citation>
      </ref>
      <ref id="ref29">
        <mixed-citation>
          29.
          <string-name>
            <given-names>CK</given-names>
            <surname>Yap</surname>
          </string-name>
          .
          <article-title>Complete subdivision algorithms, I: Intersection of Bezier curves</article-title>
          .
          <source>Proceedings of the 22nd Annual Symposium on Computational Geometry (SoCG)</source>
          , pages
          <fpage>217</fpage>
          {
          <fpage>226</fpage>
          ,
          <year>2006</year>
          . ACM.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>