**6. Appendix: Computing and updating the principal components efficiently continuous case**

#### **6.1 Continuous PCA over the boundary of a polyhedron in R**3**.**

Let *X* be a polyhedron in **R**3. We assume that the boundary of *X* is triangulated (if it is not, we can triangulate it in a preprocessing), containing *n* triangles. The *k*-th triangle, with vertices *x*1,*k*,*x*2,*k*,*x*3,*k*, can be represented in a parametric form by *Tk*(*s*, *t*) = *x*1,*<sup>k</sup>* + *s*(*x*2,*<sup>k</sup>* − *x*1,*k*) + *t*(*x*3,*<sup>k</sup>* − *x*1,*k*), for 0 ≤ *s*, *t* ≤ 1, and *s* + *t* ≤ 1. For 1 ≤ *i* ≤ 3, we denote by *xi*,*j*,*<sup>k</sup>* the *i*-th coordinate of the vertex *xj* of the triangle *Tk*. The center of gravity of the *k*-th triangle is

$$
\overrightarrow{\mu}\_k = \frac{\int\_0^1 \int\_0^{1-s} \overrightarrow{T}\_i(s, t) \, dt \, ds}{\int\_0^1 \int\_0^{1-s} \, dt \, ds} = \frac{\overrightarrow{x}\_{1,k} + \overrightarrow{x}\_{2,k} + \overrightarrow{x}\_{3,k}}{3}.
$$

The contribution of each triangle to the center of gravity of the triangulated surface is proportional to its area. The area of the *k*-th triangle is

$$a\_k = \text{area}(T\_k) = \frac{| (\vec{\mathfrak{x}}\_{2,k} - \vec{\mathfrak{x}}\_{1,k}) | \times | (\vec{\mathfrak{x}}\_{3,k} - \vec{\mathfrak{x}}\_{1,k}) |}{2}.$$

We introduce a weight to each triangle that is proportional to its area, define as

$$w\_k = \frac{a\_k}{\sum\_{i=1}^n a\_k} = \frac{a\_k}{a}.$$

where *a* is the area of *X*. Then, the center of gravity of the boundary of *X* is

$$
\vec{\mu} = \sum\_{k=1}^{n} w\_k \vec{\mu}\_k.
$$

The covariance matrix of the *k*-th triangle is

$$\begin{split} \Sigma\_{k} &= \frac{\int\_{0}^{1} \int\_{0}^{1-s} \left( \vec{T}\_{k}(s,t) - \vec{\mu} \right) \left( \vec{T}\_{k}(s,t) - \vec{\mu} \right)^{T} dt \, ds}{\int\_{0}^{1} \int\_{0}^{1-s} dt \, ds} \\ &= \frac{1}{12} \left( \sum\_{j=1}^{3} \sum\_{h=1}^{3} (\vec{x}\_{j,k} - \vec{\mu}) (\vec{x}\_{h,k} - \vec{\mu})^{T} + \sum\_{j=1}^{3} (\vec{x}\_{j,k} - \vec{\mu}) (\vec{x}\_{j,k} - \vec{\mu})^{T} \right) . \end{split}$$

The (*i*, *j*)-th element of Σ*k*, *i*, *j* ∈ {1, 2, 3}, is

$$\sigma\_{\mathbf{i}\mathbf{j},k} = \frac{1}{12} \left( \sum\_{l=1}^{3} \sum\_{h=1}^{3} (\mathbf{x}\_{i\mathbf{l},k} - \mu\_{i})(\mathbf{x}\_{\mathbf{j},h,k} - \mu\_{\mathbf{j}}) + \sum\_{l=1}^{3} (\mathbf{x}\_{i\mathbf{l},k} - \mu\_{i})(\mathbf{x}\_{\mathbf{j},l,k} - \mu\_{\mathbf{j}}) \right),$$

with *μ* = (*μ*1, *μ*2, *μ*3). Finally, the covariance matrix of the boundary of *X* is

$$
\Sigma = \sum\_{k=1}^{n} w\_k \Sigma\_k.
$$

#### **Adding points**

12 Will-be-set-by-IN-TECH

Let the new convex hull be obtained by deleting *nd* tetrahedra from and added *na* tetrahedra to the old convex hull. If the interior point *o* (needed for a tetrahedronization of a convex polytope), after several deletions, lies inside the new convex hull, then the same formulas and time complexity, as by adding points, follow. If *o* lie outside the new convex hull, then, we

• If we know that a certain point of the polyhedron will never be deleted, we can choose *o* to be that point. In that case, we also have the same closed-formed solution as for adding

• Let the facets of the convex polyhedron have similar (uniformly distributed) area. We choose *o* to be the center of gravity of the polyhedron. Then, we can expect that after deleting a point, *o* will remain in the new convex hull. However, after several deletions, *o* could lie outside the convex hull, and then we need to recompute it and the tetrahedra

Note that in the case when we consider boundary of a convex polyhedron (Subsection 6.1 and Subsection 6.3), we do not need an interior point *o* and the same time complexity holds for

In this chapter, we have presented closed-form solutions for computing and updating the principal components of (dynamic) discrete and continuous point sets. The new principal components can be computed in constant time, when a constant number of points are added or deleted from the point set. This is a significant improvement of the commonly used approach, when the new principal components are computed from scratch, which takes linear time. The advantages of some of the theoretical results were verified and presented in the context of computing dynamic PCA bounding boxes in Dimitrov, Holst, Knauer & Kriegel

An interesting open problem is to find a closed-form solutions for dynamical point sets different from convex polyhedra, for example, implicit surfaces or B-splines. An implementation of computing principal components in a dynamic, continuous setting could be a useful practical extension of the results presented here regarding continuous point sets. Applications of the results presented here in other fields, like computer vision or visualization,

**6. Appendix: Computing and updating the principal components efficiently -**

Let *X* be a polyhedron in **R**3. We assume that the boundary of *X* is triangulated (if it is not, we can triangulate it in a preprocessing), containing *n* triangles. The *k*-th triangle, with vertices

*Tk*(*s*, *t*) = *x*1,*<sup>k</sup>* + *s*(*x*2,*<sup>k</sup>* − *x*1,*k*) +

**6.1 Continuous PCA over the boundary of a polyhedron in R**3**.**

*x*1,*k*,*x*2,*k*,*x*3,*k*, can be represented in a parametric form by

Under certain assumptions, we can recompute the new principal components faster:

Thus, we need in total *O*(*n*) time to update the principal components.

, and recompute the new tetrahedra associated with it.

**Deleting points**

a point.

**5. Conclusion**

associated with it.

both adding and deleting points.

(2009); Dimitrov et al. (2011).

are of high interest.

**continuous case**

need to choose a new interior point *o*�

We add points to *X*. Let *X*� be the new convex hull. We assume that *X*� is obtained from *X* by deleting *nd*, and adding *na* tetrahedra. Then the sum of the areas of all triangles is

$$a' = \sum\_{k=1}^{n} a\_k + \sum\_{k=n+1}^{n+n\_d} a\_k - \sum\_{k=n+n\_d+1}^{n+n\_d+n\_d} a\_k = a + \sum\_{k=n+1}^{n+n\_d} a\_k - \sum\_{k=n+n\_d+1}^{n+n\_d+n\_d} a\_k.$$

of Discrete and Continuous Point Sets 15

Computing and Updating Principal Components of Discrete and Continuous Point Sets 277

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>a</sup>*� *<sup>μ</sup><sup>i</sup>* <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>a</sup>*

*<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*�

*<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*�

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*) ·

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*)

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*) +

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup>j*) +

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*j*

*j*

), (35)

). (36)

*<sup>a</sup>*� *<sup>μ</sup><sup>j</sup>* <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*)

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*). (37)

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*)

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*). (38)

*σ*� *ij*,31 =

> *σ*� *ij*,32 =

3 ∑ *l*=1

3 ∑ *l*=1

3 ∑ *l*=1

3 ∑ *l*=1

3 ∑ *l*=1

3 ∑ *l*=1

*n* ∑ *k*=1

*n* ∑ *k*=1

*n* ∑ *k*=1

3 ∑ *h*=1 *w*�

3 ∑ *h*=1 *w*�

3 ∑ *h*=1 *w*�

3 ∑ *h*=1 *w*�

3 ∑ *h*=1 *w*�

3 ∑ *h*=1 *w*�

3 ∑ *l*=1

3 ∑ *l*=1

3 ∑ *l*=1

*<sup>a</sup>*� (*μi*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

3 ∑ *h*=1

3 ∑ *h*=1

3 ∑ *h*=1

*<sup>i</sup>* and *μ*�

*n* ∑ *k*=1

= *n* ∑ *k*=1

= *n* ∑ *k*=1

> *n* ∑ *k*=1

> *n* ∑ *k*=1

> *n* ∑ *k*=1

> > 1 *a*�

<sup>=</sup> <sup>1</sup> *a*�

Plugging-in the values of *μ*�

9 *a*

Since ∑*<sup>n</sup>*

*<sup>k</sup>*=<sup>1</sup> <sup>∑</sup><sup>3</sup>

*σ*� *ij*,11 <sup>=</sup> <sup>1</sup> *a*�

*<sup>l</sup>*=<sup>1</sup> *w*�

Plugging-in the values of *μ*�

*σ*� *ij*,11 =

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

> *n*+*na*+*nd* ∑ *k*=*n*+*na*+1

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>a</sup>*

*<sup>i</sup>* and *μ*�

3 ∑ *l*=1

3 ∑ *h*=1 *w*�

3 ∑ *l*=1 *w*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup><sup>i</sup>* <sup>+</sup> *<sup>μ</sup>i*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup><sup>j</sup>* <sup>+</sup> *<sup>μ</sup>j*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) +

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup>i*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*<sup>k</sup>*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*<sup>k</sup>*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μi*) = 0, 1 ≤ *i* ≤ 3, we have

*ak*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*ak*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) +

*ak*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) +

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*<sup>j</sup>* in (32), we obtain:

*<sup>j</sup>* in (31), we obtain:

The center of gravity of *X*� is

$$\begin{split} \overrightarrow{\mu}' &= \sum\_{k=1}^{n} w\_k' \overrightarrow{\mu}\_k + \sum\_{k=n+1}^{n+n\_a} w\_k' \overrightarrow{\mu}\_k - \sum\_{k=n+n\_a+1}^{n+n\_a+n\_d} w\_k' \overrightarrow{\mu}\_k = \frac{1}{a'} \left( \sum\_{k=1}^{n} a\_k \overrightarrow{\mu}\_k + \sum\_{k=n+1}^{n+n\_a} a\_k \overrightarrow{\mu}\_k - \sum\_{k=n+n\_a+1}^{n+n\_a+n\_d} a\_k \overrightarrow{\mu}\_k \right) \\ &= \frac{1}{a'} \left( a \overrightarrow{\mu} + \sum\_{k=n+1}^{n+n\_a} a\_k \overrightarrow{\mu}\_k - \sum\_{k=n+n\_d+1}^{n+n\_d+n\_d} a\_k \overrightarrow{\mu}\_k \right). \end{split} \tag{29}$$

Let

$$
\overrightarrow{\mu}\_a = \frac{1}{a'} \sum\_{k=n+1}^{n+n\_d} a\_k \overrightarrow{\mu}\_{k'} \quad \text{and} \quad \overrightarrow{\mu}\_d = \frac{1}{a'} \sum\_{k=n+n\_d+1}^{n+n\_d+n\_d} a\_k \overrightarrow{\mu}\_k.
$$

Then, we can rewrite (29) as

$$
\vec{\mu}' = \frac{a}{a'}\vec{\mu} + \vec{\mu}\_a - \vec{\mu}\_d.\tag{30}
$$

The *i*-th component of *μ<sup>a</sup>* and *μd*, 1 ≤ *i* ≤ 3, is denoted by *μi*,*<sup>a</sup>* and *μi*,*d*, respectively. The (*i*, *j*)-th component, *σ*� *ij*, 1 ≤ *i*, *j* ≤ 3, of the covariance matrix Σ� of *X*� is

$$
\begin{split}
\sigma'\_{ij} &= \frac{1}{12} \left( \sum\_{k=1}^{n} \sum\_{l=1}^{3} \sum\_{h=1}^{3} w'\_{k} (\mathbf{x}\_{i,l,k} - \mu'\_{i}) (\mathbf{x}\_{j,h,k} - \mu'\_{j}) + \sum\_{k=1}^{n} \sum\_{l=1}^{3} w'\_{k} (\mathbf{x}\_{i,l,k} - \mu'\_{i}) (\mathbf{x}\_{j,l,k} - \mu'\_{j}) \right) + \\
& \frac{1}{12} \left( \sum\_{k=n+1}^{n+n} \sum\_{l=1}^{3} \sum\_{h=1}^{3} w'\_{k} (\mathbf{x}\_{i,l,k} - \mu'\_{i}) (\mathbf{x}\_{j,h,k} - \mu'\_{j}) + \sum\_{k=n+1}^{n+n} \sum\_{l=1}^{3} w'\_{k} (\mathbf{x}\_{i,l,k} - \mu'\_{i}) (\mathbf{x}\_{j,l,k} - \mu'\_{j}) - \\
& \sum\_{k=n+n+4}^{n+n} \sum\_{l=1}^{3} \sum\_{h=1}^{3} w'\_{k} (\mathbf{x}\_{i,l,k} - \mu'\_{i}) (\mathbf{x}\_{j,h,k} - \mu'\_{j}) - \\
& \sum\_{k=n+n+4}^{n+n} \sum\_{l=1}^{3} w'\_{k} (\mathbf{x}\_{i,l,k} - \mu'\_{i}) (\mathbf{x}\_{j,l,k} - \mu'\_{j}) ).
\end{split}
$$

Let

$$
\sigma'\_{ij} = \frac{1}{12} (\sigma'\_{ij,11} + \sigma'\_{ij,12} + \sigma'\_{ij,21} + \sigma'\_{ij,22} - \sigma'\_{ij,31} - \sigma'\_{ij,32}) / \sigma
$$

where

$$\sigma\_{\vec{l}\vec{j},11}^{\prime} = \sum\_{k=1}^{n} \sum\_{l=1}^{3} \sum\_{h=1}^{3} w\_k^{\prime} (\mathbf{x}\_{i,l,k} - \mu\_i^{\prime}) (\mathbf{x}\_{j,h,k} - \mu\_j^{\prime}),\tag{31}$$

$$\sigma\_{ij,12}' = \sum\_{k=1}^{n} \sum\_{l=1}^{3} w\_k'(\mathbf{x}\_{i,l,k} - \mu\_i')(\mathbf{x}\_{j,l,k} - \mu\_j') \,. \tag{32}$$

$$1.5mm\sigma\_{ij,21}^{\prime} = \sum\_{k=n+1}^{n+n\_d} \sum\_{l=1}^{3} \sum\_{h=1}^{3} w\_k^{\prime} (\mathbf{x}\_{i,l,k} - \mu\_i^{\prime})(\mathbf{x}\_{j,h,k} - \mu\_j^{\prime}),\tag{33}$$

$$1.5mm\sigma\_{ij,22}^{\prime} = \sum\_{k=n+1}^{n+n\_a} \sum\_{l=1}^{3} w\_k^{\prime} (\mathbf{x}\_{i,l,k} - \mu\_i^{\prime})(\mathbf{x}\_{j,l,k} - \mu\_j^{\prime}),\tag{34}$$

$$
\sigma'\_{ij,31} = \sum\_{k=n+n\_d+1}^{n+n\_d+n\_d} \sum\_{l=1}^3 \sum\_{h=1}^3 w'\_k(\mathbf{x}\_{i,l,k} - \mu'\_i)(\mathbf{x}\_{j,h,k} - \mu'\_j), \tag{35}
$$

$$
\sigma\_{ij,22}' = \sum\_{k=n+n\_d+1}^{n+n\_d+n\_d} \sum\_{l=1}^3 w\_k'(\mathbf{x}\_{i,l,k} - \mu\_i')(\mathbf{x}\_{j,l,k} - \mu\_j'). \tag{36}
$$

Plugging-in the values of *μ*� *<sup>i</sup>* and *μ*� *<sup>j</sup>* in (31), we obtain:

14 Will-be-set-by-IN-TECH

*ak<sup>μ</sup>k*, and *<sup>μ</sup><sup>d</sup>* <sup>=</sup> <sup>1</sup>

The *i*-th component of *μ<sup>a</sup>* and *μd*, 1 ≤ *i* ≤ 3, is denoted by *μi*,*<sup>a</sup>* and *μi*,*d*, respectively. The

*j* ) + *n* ∑ *k*=1

> *j* ) +

*j* ) .

*ij*,21 + *σ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*�

*ij*, 1 ≤ *i*, *j* ≤ 3, of the covariance matrix Σ� of *X*� is

 *n* ∑ *k*=1

*a*�

3 ∑ *l*=1 *w*�

*n*+*na* ∑ *k*=*n*+1

*ij*,22 − *σ*�

*<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*�

*<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*ij*,31 − *σ*�

*j*

*j*

*<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*�

*<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*�

*j*

*j*

*j* ) −

3 ∑ *l*=1 *w*�

*akμ<sup>k</sup>* +

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

*n*+*na* ∑ *k*=*n*+1

. (29)

*akμk*.

*μ* +*μ<sup>a</sup>* −*μd*. (30)

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*ij*,32),

*<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*�

*j* ) +

*<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*�

), (31)

), (32)

), (33)

), (34)

*j* ) −

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*akμ<sup>k</sup>* −

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1 *akμ<sup>k</sup>* 

The center of gravity of *X*� is

Then, we can rewrite (29) as

3 ∑ *l*=1

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

> *σ*� *ij* <sup>=</sup> <sup>1</sup> <sup>12</sup> (*σ*�

3 ∑ *h*=1 *w*�

3 ∑ *l*=1

3 ∑ *h*=1 *w*�

> 3 ∑ *l*=1

3 ∑ *l*=1 *w*�

> *σ*� *ij*,11 =

> > *σ*� *ij*,12 =

> > > *ij*,21 =

*ij*,22 =

1.5*mmσ*�

1.5*mmσ*�

3 ∑ *h*=1 *w*�

(*i*, *j*)-th component, *σ*�

1 12  *<sup>n</sup>*+*na* ∑ *k*=*n*+1

*n*+*na* ∑ *k*=*n*+1

*n*+*na* ∑ *k*=*n*+1 *w*� *<sup>k</sup>μ<sup>k</sup>* −

*akμ<sup>k</sup>* −

*<sup>μ</sup><sup>a</sup>* <sup>=</sup> <sup>1</sup> *a*�

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

> *n*+*na* ∑ *k*=*n*+1

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*ij*,11 + *σ*�

3 ∑ *l*=1

*n* ∑ *k*=1

*n*+*na* ∑ *k*=*n*+1

> *n*+*na* ∑ *k*=*n*+1

3 ∑ *l*=1

3 ∑ *h*=1 *w*�

3 ∑ *l*=1 *w*�

3 ∑ *l*=1 *w*�

3 ∑ *h*=1 *w*�

*n* ∑ *k*=1

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*w*� *<sup>k</sup><sup>μ</sup><sup>k</sup>* <sup>=</sup> <sup>1</sup> *a*�

*akμ<sup>k</sup>* 

*<sup>μ</sup>*� <sup>=</sup> *<sup>a</sup> a*�

*<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*�

*<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*�

*<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*�

*ij*,12 + *σ*�

*μ*� =

Let

*σ*� *ij* <sup>=</sup> <sup>1</sup> 12 *<sup>n</sup>* ∑ *k*=1

Let

where

*n* ∑ *k*=1 *w*� *<sup>k</sup>μ<sup>k</sup>* +

> *aμ* +

<sup>=</sup> <sup>1</sup> *a*�

*σ*� *ij*,11 = *n* ∑ *k*=1 3 ∑ *l*=1 3 ∑ *h*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>a</sup> <sup>a</sup>*� *<sup>μ</sup><sup>i</sup>* <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>a</sup> <sup>a</sup>*� *<sup>μ</sup><sup>j</sup>* <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*) = *n* ∑ *k*=1 3 ∑ *l*=1 3 ∑ *h*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup><sup>i</sup>* <sup>+</sup> *<sup>μ</sup>i*(<sup>1</sup> <sup>−</sup> *<sup>a</sup> <sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*) · (*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup><sup>j</sup>* <sup>+</sup> *<sup>μ</sup>j*(<sup>1</sup> <sup>−</sup> *<sup>a</sup> <sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*) = *n* ∑ *k*=1 3 ∑ *l*=1 3 ∑ *h*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) + *n* ∑ *k*=1 3 ∑ *l*=1 3 ∑ *h*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup>i*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>a</sup> <sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*) + *n* ∑ *k*=1 3 ∑ *l*=1 3 ∑ *h*=1 *w*� *<sup>k</sup>*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>a</sup> <sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup>j*) + *n* ∑ *k*=1 3 ∑ *l*=1 3 ∑ *h*=1 *w*� *<sup>k</sup>*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>a</sup> <sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>a</sup> <sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*). (37)

Since ∑*<sup>n</sup> <sup>k</sup>*=<sup>1</sup> <sup>∑</sup><sup>3</sup> *<sup>l</sup>*=<sup>1</sup> *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μi*) = 0, 1 ≤ *i* ≤ 3, we have

$$
\sigma\_{ij,11}' = \frac{1}{a'} \sum\_{k=1}^{n} \sum\_{l=1}^{3} \sum\_{h=1}^{3} a\_k (\mathbf{x}\_{il,k} - \mu\_i)(\mathbf{x}\_{jh,k} - \mu\_j) + 
$$

$$
\frac{1}{a'} \sum\_{k=1}^{n} \sum\_{l=1}^{3} \sum\_{h=1}^{3} a\_k (\mu\_i(1 - \frac{a}{a'}) - \mu\_{i,a} + \mu\_{i,d})(\mu\_j(1 - \frac{a}{a'}) - \mu\_{j,a} + \mu\_{j,d})
$$

$$
= \frac{1}{a'} \sum\_{k=1}^{n} \sum\_{l=1}^{3} \sum\_{h=1}^{3} a\_k (\mathbf{x}\_{il,k} - \mu\_i)(\mathbf{x}\_{jh,k} - \mu\_j) +
$$

$$
\Phi \frac{a}{a'} (\mu\_i(1 - \frac{a}{a'}) - \mu\_{i,a} + \mu\_{i,d})(\mu\_j(1 - \frac{a}{a'}) - \mu\_{j,a} + \mu\_{j,d}).
\tag{38}
$$

Plugging-in the values of *μ*� *<sup>i</sup>* and *μ*� *<sup>j</sup>* in (32), we obtain:

of Discrete and Continuous Point Sets 17

Computing and Updating Principal Components of Discrete and Continuous Point Sets 279

Let the new convex hull be obtained by deleting *nd* tetrahedra from and added *na* tetrahedra to the old convex hull. Consequently, the same formulas and time complexity, as by adding

We assume that the polygon *X* is triangulated (if it is not, we can triangulate it in a preprocessing), and the number of triangles is *n*. The *k*-th triangle, with vertices

The contribution of each triangle to the center of gravity of *X* is proportional to its area. The

*ak* <sup>=</sup> area(*Tk*) = <sup>|</sup>(*<sup>x</sup>*2,*<sup>k</sup>* <sup>−</sup>*<sup>x</sup>*1,*k*)|×|(*<sup>x</sup>*3,*<sup>k</sup>* <sup>−</sup>*<sup>x</sup>*1,*k*)<sup>|</sup>

where × denotes the vector product. We introduce a weight to each triangle that is

*n* ∑ *k*=1

*wkμk*.

*Tk*(*s*, *<sup>t</sup>*) <sup>−</sup>*<sup>μ</sup>*)*<sup>T</sup> dt ds*

*<sup>T</sup>* + 3 ∑ *j*=1

> 3 ∑ *l*=1

*wk* <sup>=</sup> *ak* ∑*n <sup>k</sup>*=<sup>1</sup> *ak*

*μ* =

(*xj*,*<sup>k</sup>* −*μ*)(*xh*,*<sup>k</sup>* −*μ*)

(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) +

Σ =

*n* ∑ *k*=1

*wk*Σ*k*.

*Tk*(*s*, *<sup>t</sup>*) <sup>−</sup>*<sup>μ</sup>*) (

 1 0 <sup>1</sup>−*<sup>s</sup>* <sup>0</sup> *dt ds*

<sup>0</sup> *dt ds* <sup>=</sup> *<sup>x</sup>*1,*<sup>k</sup>* <sup>+</sup>*<sup>x</sup>*2,*<sup>k</sup>* <sup>+</sup>*<sup>x</sup>*3,*<sup>k</sup>*

<sup>=</sup> *ak a* , <sup>3</sup> .

<sup>2</sup> ,

(*xj*,*<sup>k</sup>* −*μ*)(*xj*,*<sup>k</sup>* −*μ*)

(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*l*,*<sup>k</sup>* − *μj*)

*T* .

> ,

*t*(*x*2,*<sup>k</sup>* −*x*3,*k*), for 0 ≤ *s*, *t* ≤ 1, and *s* + *t* ≤ 1. The center of gravity of the *k*-th triangle is

*Ti*(*s*, *t*) *dt ds*

*Ti*(*s*, *t*) = *x*3,*<sup>k</sup>* + *s*(*x*1,*<sup>k</sup>* −*x*3,*k*) +

**Deleting points**

points, follow.

area of the *i*-th triangle is

proportional to its area, define as

**6.2 Continuous PCA over a polygon in R**<sup>2</sup>

*x*1,*k*,*x*2,*k*,*x*3,*<sup>k</sup>* = *o*, can be represented in a parametric form by

 1 0 <sup>1</sup>−*<sup>s</sup>* <sup>0</sup>

where *a* is the area of *X*.Then, the center of gravity of *X* is

3 ∑ *h*=1

3 ∑ *h*=1

with *μ* = (*μ*1, *μ*2). The covariance matrix of *X* is

The covariance matrix of the *k*-th triangle is

 1 0 <sup>1</sup>−*<sup>s</sup>* <sup>0</sup> (

<sup>=</sup> <sup>1</sup> 12 <sup>3</sup> ∑ *j*=1

The (*i*, *j*)-th element of Σ*k*, *i*, *j* ∈ {1, 2}, is

Σ*<sup>k</sup>* =

*<sup>σ</sup>ij*,*<sup>k</sup>* <sup>=</sup> <sup>1</sup> 12 <sup>3</sup> ∑ *l*=1  1 0 <sup>1</sup>−*<sup>s</sup>*

*μ<sup>i</sup>* =

$$\begin{split} \sigma\_{jl,12}^{\prime} &= \sum\_{k=1}^{n} \sum\_{l=1}^{3} w\_{k}^{\prime} (\mathbf{x}\_{iJ,k} - \frac{a}{a^{\prime}} \mu\_{i} - \mu\_{i,a} + \mu\_{j,d}) (\mathbf{x}\_{j,h,k} - \frac{a}{a} \mu\_{j} - \mu\_{j,a} + \mu\_{j,d}) \\ &= \sum\_{k=1}^{n} \sum\_{l=1}^{3} w\_{k}^{\prime} (\mathbf{x}\_{iJ,k} - \mu\_{i} + \mu\_{i} (1 - \frac{a}{d^{\prime}}) - \mu\_{i,a} + \mu\_{j,d}) \cdot \\ & \quad (\mathbf{x}\_{jh,k} - \mu\_{j} + \mu\_{j} (1 - \frac{a}{d^{\prime}}) - \mu\_{j,d} + \mu\_{j,d}) \\ &= \sum\_{k=1}^{n} \sum\_{l=1}^{3} w\_{k}^{\prime} (\mathbf{x}\_{iJ,k} - \mu\_{i}) (\mathbf{x}\_{jh,k} - \mu\_{j}) + \\ & \quad \sum\_{k=1}^{n} \sum\_{l=1}^{3} w\_{k}^{\prime} (\mathbf{x}\_{iJ,k} - \mu\_{i}) (\mu\_{j} (1 - \frac{a}{d^{\prime}}) - \mu\_{j,a} + \mu\_{j,d}) + \\ & \quad \sum\_{k=1}^{n} \sum\_{l=1}^{3} w\_{k}^{\prime} (\mu\_{l} (1 - \frac{a}{d^{\prime}}) - \mu\_{i,a} + \mu\_{i,d}) (\mu\_{j,h,k} - \mu\_{j}) + \\ & \quad \sum\_{k=1}^{n} \sum\_{l=1}^{3} w\_{k}^{\prime} (\mu\_{l} (1 - \$$

Since ∑*<sup>n</sup> <sup>k</sup>*=<sup>1</sup> <sup>∑</sup><sup>3</sup> *<sup>l</sup>*=<sup>1</sup> *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μi*) = 0, 1 ≤ *i* ≤ 3, we have

$$\begin{split} \sigma\_{ij,12}' &= \frac{1}{a'} \sum\_{k=1}^{n} \sum\_{l=1}^{3} a\_k (\mathbf{x}\_{i,l,k} - \mu\_i)(\mathbf{x}\_{j,h,k} - \mu\_j) + \\ & \quad \frac{1}{a'} \sum\_{k=1}^{n} \sum\_{l=1}^{3} a\_k (\mu\_i(1 - \frac{a}{a'}) - \mu\_{i,a} + \mu\_{i,d})(\mu\_j(1 - \frac{a}{a'}) - \mu\_{j,a} + \mu\_{j,d}) \\ & \quad = \frac{1}{a'} \sum\_{k=1}^{n} \sum\_{l=1}^{3} a\_k (\mathbf{x}\_{i,l,k} - \mu\_i)(\mathbf{x}\_{j,h,k} - \mu\_j) + \\ & \quad 3 \frac{a}{a'} (\mu\_i(1 - \frac{a}{a'}) - \mu\_{i,a} + \mu\_{i,d})(\mu\_j(1 - \frac{a}{a'}) - \mu\_{j,a} + \mu\_{j,d}). \end{split} \tag{40}$$

From (39) and (40), we obtain

$$\begin{split} \sigma\_{ij,1}^{\prime} &= \sigma\_{ij,11}^{\prime} + \sigma\_{ij,12}^{\prime} \\ &= \sigma\_{ij} + 12\frac{a}{a^{\prime}}(\mu\_{i}(1-\frac{a}{a^{\prime}}) - \mu\_{i,a} + \mu\_{i,d})(\mu\_{j}(1-\frac{a}{a^{\prime}}) - \mu\_{j,a} + \mu\_{j,d}). \end{split} \tag{41}$$

Note that *σ*� *ij*,1 can be computed in *O*(1) time. The components *σ*� *ij*,21 and *σ*� *ij*,22 can be computed in *O*(*na*) time, while *O*(*nd*) time is needed to compute *σ*� *ij*,31 and *σ*� *ij*,32. Thus, *<sup>μ</sup>*� and

$$
\sigma'\_{ij} = \frac{1}{12} (\sigma'\_{ij,11} + \sigma'\_{ij,12} + \sigma'\_{ij,21} + \sigma'\_{ij,22} + \sigma'\_{ij,31} + \sigma'\_{ij,32}) = \frac{1}{12} (\sigma\_{ij} + \sigma'\_{ij,21} + \sigma'\_{ij,22} + \sigma'\_{ij,31} + \sigma\_{ij,32}) + \dotsb
$$

$$
\frac{a}{a'} (\mu\_{i}(1 - \frac{a}{a'}) - \mu\_{i,d} + \mu\_{j,d}) (\mu\_{j}(1 - \frac{a}{a'}) - \mu\_{j,d} + \mu\_{j,d}).
\tag{42}
$$

can be computed in *O*(*na* + *nd*) time.

#### **Deleting points**

16 Will-be-set-by-IN-TECH

*<sup>a</sup>*� *<sup>μ</sup><sup>i</sup>* <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>a</sup>*

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*) ·

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*)

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*) +

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup>j*) +

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*ij*,32) = <sup>1</sup>

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*<sup>a</sup>*� *<sup>μ</sup><sup>j</sup>* <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*)

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*). (39)

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*)

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*). (40)

*ij*,32. Thus, *<sup>μ</sup>*� and

*ij*,21 and *σ*�

*ij*,21 + *σ*�

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*). (42)

*ij*,31 and *σ*�

<sup>12</sup> (*σij* <sup>+</sup> *<sup>σ</sup>*�

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*). (41)

*ij*,22 + *σ*�

*ij*,22 can be computed

*ij*,31 + *σij*,32) +

*σ*� *ij*,12 =

Since ∑*<sup>n</sup>*

*<sup>k</sup>*=<sup>1</sup> <sup>∑</sup><sup>3</sup>

*σ*� *ij*,12 <sup>=</sup> <sup>1</sup> *a*�

From (39) and (40), we obtain

*σ*� *ij*,1 = *σ*�

*ij*,11 + *σ*�

can be computed in *O*(*na* + *nd*) time.

*<sup>a</sup>*� (*μi*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

Note that *σ*�

*a*

*σ*� *ij* <sup>=</sup> <sup>1</sup> <sup>12</sup> (*σ*� *<sup>l</sup>*=<sup>1</sup> *w*�

*n* ∑ *k*=1

= *n* ∑ *k*=1

= *n* ∑ *k*=1

> *n* ∑ *k*=1

> *n* ∑ *k*=1

> *n* ∑ *k*=1

3 ∑ *l*=1 *w*�

3 ∑ *l*=1 *w*�

3 ∑ *l*=1 *w*�

3 ∑ *l*=1 *w*�

3 ∑ *l*=1 *w*�

3 ∑ *l*=1 *w*�

*n* ∑ *k*=1

*n* ∑ *k*=1

*n* ∑ *k*=1

1 *a*�

<sup>=</sup> <sup>1</sup> *a*�

3 *a*

3 ∑ *l*=1

3 ∑ *l*=1

3 ∑ *l*=1

*<sup>a</sup>*� (*μi*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*ij*,11 + *σ*�

<sup>=</sup> *<sup>σ</sup>ij* <sup>+</sup> <sup>12</sup> *<sup>a</sup>*

*ij*,12 + *σ*�

*ij*,12

in *O*(*na*) time, while *O*(*nd*) time is needed to compute *σ*�

*ij*,21 + *σ*�

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*<sup>a</sup>*� (*μi*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*ij*,1 can be computed in *O*(1) time. The components *σ*�

*ij*,22 + *σ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>a</sup>*

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup><sup>i</sup>* <sup>+</sup> *<sup>μ</sup>i*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup><sup>j</sup>* <sup>+</sup> *<sup>μ</sup>j*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) +

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup>i*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*<sup>k</sup>*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*<sup>k</sup>*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μi*) = 0, 1 ≤ *i* ≤ 3, we have

*ak*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*ak*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) +

*ak*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) +

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*ij*,31 + *σ*�

Let the new convex hull be obtained by deleting *nd* tetrahedra from and added *na* tetrahedra to the old convex hull. Consequently, the same formulas and time complexity, as by adding points, follow.

#### **6.2 Continuous PCA over a polygon in R**<sup>2</sup>

We assume that the polygon *X* is triangulated (if it is not, we can triangulate it in a preprocessing), and the number of triangles is *n*. The *k*-th triangle, with vertices *x*1,*k*,*x*2,*k*,*x*3,*<sup>k</sup>* = *o*, can be represented in a parametric form by *Ti*(*s*, *t*) = *x*3,*<sup>k</sup>* + *s*(*x*1,*<sup>k</sup>* −*x*3,*k*) + *t*(*x*2,*<sup>k</sup>* −*x*3,*k*), for 0 ≤ *s*, *t* ≤ 1, and *s* + *t* ≤ 1. The center of gravity of the *k*-th triangle is

$$
\vec{\mu\_i} = \frac{\int\_0^1 \int\_0^{1-s} \vec{T\_i}(s, t) \, dt \, ds}{\int\_0^1 \int\_0^{1-s} \, dt \, ds} = \frac{\vec{x}\_{1,k} + \vec{x}\_{2,k} + \vec{x}\_{3,k}}{3}.
$$

The contribution of each triangle to the center of gravity of *X* is proportional to its area. The area of the *i*-th triangle is

$$a\_k = \text{area}(T\_k) = \frac{| (\vec{\mathfrak{x}}\_{2,k} - \vec{\mathfrak{x}}\_{1,k}) | \times | (\vec{\mathfrak{x}}\_{3,k} - \vec{\mathfrak{x}}\_{1,k}) |}{2} \rangle$$

where × denotes the vector product. We introduce a weight to each triangle that is proportional to its area, define as

$$w\_k = \frac{a\_k}{\sum\_{k=1}^n a\_k} = \frac{a\_k}{a}.$$

where *a* is the area of *X*.Then, the center of gravity of *X* is

$$
\overrightarrow{\mu} = \sum\_{k=1}^{n} w\_k \overrightarrow{\mu}\_k.
$$

The covariance matrix of the *k*-th triangle is

$$\begin{split} \Sigma\_{k} &= \frac{\int\_{0}^{1} \int\_{0}^{1-s} \left( \vec{T}\_{k}(s,t) - \vec{\mu} \right) \left( \vec{T}\_{k}(s,t) - \vec{\mu} \right)^{T} dt \, ds}{\int\_{0}^{1} \int\_{0}^{1-s} dt \, ds} \\ &= \frac{1}{12} \left( \sum\_{j=1}^{3} \sum\_{h=1}^{3} (\vec{\mathfrak{x}}\_{j,k} - \vec{\mu})(\vec{\mathfrak{x}}\_{h,k} - \vec{\mu})^{T} + \sum\_{j=1}^{3} (\vec{\mathfrak{x}}\_{j,k} - \vec{\mu})(\vec{\mathfrak{x}}\_{j,k} - \vec{\mu})^{T} \right) . \end{split}$$

The (*i*, *j*)-th element of Σ*k*, *i*, *j* ∈ {1, 2}, is

$$\sigma\_{\vec{i}\vec{j},k} = \frac{1}{12} \left( \sum\_{l=1}^{3} \sum\_{h=1}^{3} (\mathbf{x}\_{i,l,k} - \boldsymbol{\mu}\_{i})(\mathbf{x}\_{\vec{j},h,k} - \boldsymbol{\mu}\_{\vec{j}}) + \sum\_{l=1}^{3} (\mathbf{x}\_{i,l,k} - \boldsymbol{\mu}\_{i})(\mathbf{x}\_{\vec{j},l,k} - \boldsymbol{\mu}\_{\vec{j}}) \right) \mathbf{x}\_{\vec{k}}$$

with *μ* = (*μ*1, *μ*2). The covariance matrix of *X* is

$$
\Sigma = \sum\_{k=1}^{n} w\_k \Sigma\_k.
$$

of Discrete and Continuous Point Sets 19

Computing and Updating Principal Components of Discrete and Continuous Point Sets 281

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>a</sup>*� *<sup>μ</sup><sup>i</sup>* <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>a</sup>*

*<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*�

*j*

*j*

*j*

*<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*�

*<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*�

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*) ·

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*)

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*) +

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup>j*) +

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

), (48)

), (49)

). (50)

*<sup>a</sup>*� *<sup>μ</sup><sup>j</sup>* <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*)

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*). (51)

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*)

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*). (52)

*σ*� *ij*,22 =

*σ*� *ij*,31 =

Plugging-in the values of *μ*�

*n* ∑ *k*=1

= *n* ∑ *k*=1

= *n* ∑ *k*=1

> *n* ∑ *k*=1

> *n* ∑ *k*=1

> *n* ∑ *k*=1

Since ∑*<sup>n</sup>*

*<sup>k</sup>*=<sup>1</sup> <sup>∑</sup><sup>3</sup>

*σ*� *ij*,11 <sup>=</sup> <sup>1</sup> *a*�

*<sup>l</sup>*=<sup>1</sup> *w*�

3 ∑ *l*=1

3 ∑ *l*=1

3 ∑ *l*=1

3 ∑ *l*=1

3 ∑ *l*=1

3 ∑ *l*=1

*n* ∑ *k*=1

*n* ∑ *k*=1

*n* ∑ *k*=1

1 *a*�

<sup>=</sup> <sup>1</sup> *a*�

9 *a*

3 ∑ *l*=1

3 ∑ *l*=1

3 ∑ *l*=1

*<sup>a</sup>*� (*μi*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

3 ∑ *h*=1

3 ∑ *h*=1

3 ∑ *h*=1

3 ∑ *h*=1 *w*�

3 ∑ *h*=1 *w*�

3 ∑ *h*=1 *w*�

3 ∑ *h*=1 *w*�

3 ∑ *h*=1 *w*�

3 ∑ *h*=1 *w*�

*σ*� *ij*,11 = *σ*� *ij*,32 =

*n*+*na* ∑ *k*=*n*+1

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>a</sup>*

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

*<sup>i</sup>* and *μ*�

3 ∑ *l*=1 *w*�

3 ∑ *l*=1

3 ∑ *h*=1 *w*�

3 ∑ *l*=1 *w*�

*<sup>j</sup>* in (45), we obtain:

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup><sup>i</sup>* <sup>+</sup> *<sup>μ</sup>i*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup><sup>j</sup>* <sup>+</sup> *<sup>μ</sup>j*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) +

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup>i*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*<sup>k</sup>*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*<sup>k</sup>*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μi*) = 0, 1 ≤ *i* ≤ 2, we have

*ak*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*ak*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) +

*ak*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) +

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

#### **Adding points**

We add points to *X*. Let *X*� be the new convex hull. We assume that *X*� is obtained from *X* by deleting *nd*, and adding *na* triangles. Then the sum of the areas of all triangles is

$$a' = \sum\_{k=1}^{n} a\_k + \sum\_{k=n+1}^{n+n\_d} a\_k - \sum\_{k=n+n\_d+1}^{n+n\_d+n\_d} a\_k = a + \sum\_{k=n+1}^{n+n\_d} a\_k - \sum\_{k=n+n\_d+1}^{n+n\_d+n\_d} a\_k.$$

The center of gravity of *X*� is

$$\begin{split} \overrightarrow{\mu}^{\prime} &= \sum\_{k=1}^{n} w\_{k}^{\prime} \overrightarrow{\mu}\_{k} + \sum\_{k=n+1}^{n+u\_{a}} w\_{k}^{\prime} \overrightarrow{\mu}\_{k} - \sum\_{k=n+u\_{d}+1}^{n+u\_{d}+u\_{d}} w\_{k}^{\prime} \overrightarrow{\mu}\_{k} = \frac{1}{a^{\prime}} \left( \sum\_{k=1}^{n} a\_{k} \overrightarrow{\mu}\_{k} + \sum\_{k=n+1}^{n+u\_{d}} a\_{k} \overrightarrow{\mu}\_{k} - \sum\_{k=n+u\_{d}+1}^{n+u\_{d}+u\_{d}} a\_{k} \overrightarrow{\mu}\_{k} \right) \\ &= \frac{1}{a^{\prime}} \left( a \overrightarrow{\mu} + \sum\_{k=n+1}^{n+u\_{d}} a\_{k} \overrightarrow{\mu}\_{k} - \sum\_{k=n+u\_{d}+1}^{n+u\_{d}+u\_{d}} a\_{k} \overrightarrow{\mu}\_{k} \right). \end{split} \tag{43}$$

Let

$$
\overrightarrow{\mu}\_d = \frac{1}{a'} \sum\_{k=n+1}^{n+n\_d} a\_k \overrightarrow{\mu}\_{k'} \quad \text{and} \quad \overrightarrow{\mu}\_d = \frac{1}{a'} \sum\_{k=n+n\_d+1}^{n+n\_d+n\_d} a\_k \overrightarrow{\mu}\_k.
$$

Then, we can rewrite (43) as

$$
\vec{\mu}' = \frac{a}{a'}\vec{\mu} + \vec{\mu}\_a - \vec{\mu}\_d.\tag{44}
$$

The *i*-th component of *μ<sup>a</sup>* and *μd*, 1 ≤ *i* ≤ 2, is denoted by *μi*,*<sup>a</sup>* and *μi*,*d*, respectively. The (*i*, *j*)-th component, *σ*� *ij*, 1 ≤ *i*, *j* ≤ 2, of the covariance matrix Σ� of *X*� is

*σ*� *ij* <sup>=</sup> <sup>1</sup> 12 *<sup>n</sup>* ∑ *k*=1 3 ∑ *l*=1 3 ∑ *h*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*� *<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*� *j* ) + *n* ∑ *k*=1 3 ∑ *l*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*� *<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*� *j* ) + 1 12 *<sup>n</sup>*+*na* ∑ *k*=*n*+1 3 ∑ *l*=1 3 ∑ *h*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*� *<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*� *j* ) + *n*+*na* ∑ *k*=*n*+1 3 ∑ *l*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*� *<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*� *j* ) − *n*+*na*+*nd* ∑ *k*=*n*+*na*+1 3 ∑ *l*=1 3 ∑ *h*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*� *<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*� *j* ) − *n*+*na*+*nd* ∑ *k*=*n*+*na*+1 3 ∑ *l*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*� *<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*� *j* ) .

Let

$$
\sigma'\_{ij} = \frac{1}{12} (\sigma'\_{ij,11} + \sigma'\_{ij,12} + \sigma'\_{ij,21} + \sigma'\_{ij,22} - \sigma'\_{ij,31} - \sigma'\_{ij,32}) / \sigma
$$

where

$$\sigma\_{ij,11}' = \sum\_{k=1}^{n} \sum\_{l=1}^{3} \sum\_{h=1}^{3} w\_k'(\mathbf{x}\_{i,l,k} - \mu\_i')(\mathbf{x}\_{j,h,k} - \mu\_j'),\tag{45}$$

$$
\sigma\_{ij,12}' = \sum\_{k=1}^{n} \sum\_{l=1}^{3} w\_k'(\mathbf{x}\_{i,l,k} - \mu\_i')(\mathbf{x}\_{j,l,k} - \mu\_j'),
\tag{46}
$$

$$\sigma\_{ij,21}' = \sum\_{k=n+1}^{n+n\_a} \sum\_{l=1}^3 \sum\_{h=1}^3 w\_k'(\mathbf{x}\_{i,l,k} - \mu\_i')(\mathbf{x}\_{j,h,k} - \mu\_j'),\tag{47}$$

$$\sigma\_{\rm ij,22}^{\prime} = \sum\_{k=n+1}^{n+n\_{\rm a}} \sum\_{l=1}^{3} w\_k^{\prime} (\mathbf{x}\_{\rm i,l,k} - \mu\_i^{\prime}) (\mathbf{x}\_{\rm j,l,k} - \mu\_j^{\prime}),\tag{48}$$

$$
\sigma'\_{\mathbf{j}\mathbf{j},31} = \sum\_{k=n+n\_d+1}^{n+n\_d+n\_d} \sum\_{l=1}^3 \sum\_{h=1}^3 w'\_k(\mathbf{x}\_{i,l,k} - \mu'\_i)(\mathbf{x}\_{\mathbf{j},h,k} - \mu'\_j),
\tag{49}
$$

$$
\sigma'\_{ij,32} = \sum\_{k=n+n\_d+1}^{n+n\_d+n\_d} \sum\_{l=1}^3 w'\_k(\mathbf{x}\_{i,l,k} - \mu'\_i)(\mathbf{x}\_{j,l,k} - \mu'\_j). \tag{50}
$$

Plugging-in the values of *μ*� *<sup>i</sup>* and *μ*� *<sup>j</sup>* in (45), we obtain:

18 Will-be-set-by-IN-TECH

We add points to *X*. Let *X*� be the new convex hull. We assume that *X*� is obtained from *X* by

*ak* = *a* +

 *n* ∑ *k*=1

*a*�

3 ∑ *l*=1 *w*�

*n*+*na* ∑ *k*=*n*+1

*ij*,22 − *σ*�

*ij*,31 − *σ*�

*j*

*<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*�

*j*

*j*

*<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*�

*<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*�

*j* ) −

3 ∑ *l*=1 *w*�

*n*+*na* ∑ *k*=*n*+1

*akμ<sup>k</sup>* +

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

*ak* −

*n*+*na* ∑ *k*=*n*+1

. (43)

*akμk*.

*μ* +*μ<sup>a</sup>* −*μd*. (44)

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*ij*,32),

*<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*�

*j* ) +

*<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*�

), (45)

), (46)

), (47)

*j* ) −

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

*akμ<sup>k</sup>* −

*ak*.

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1 *akμ<sup>k</sup>* 

deleting *nd*, and adding *na* triangles. Then the sum of the areas of all triangles is

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

> *w*� *<sup>k</sup><sup>μ</sup><sup>k</sup>* <sup>=</sup> <sup>1</sup> *a*�

*akμ<sup>k</sup>* 

*<sup>μ</sup>*� <sup>=</sup> *<sup>a</sup> a*�

*<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*�

*<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*�

*<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*�

*ij*,12 + *σ*�

3 ∑ *h*=1 *w*�

3 ∑ *l*=1 *w*�

3 ∑ *l*=1

3 ∑ *h*=1 *w*�

*ak<sup>μ</sup>k*, and *<sup>μ</sup><sup>d</sup>* <sup>=</sup> <sup>1</sup>

The *i*-th component of *μ<sup>a</sup>* and *μd*, 1 ≤ *i* ≤ 2, is denoted by *μi*,*<sup>a</sup>* and *μi*,*d*, respectively. The

*j* ) + *n* ∑ *k*=1

> *j* ) +

*j* ) .

*ij*,21 + *σ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*�

*ij*, 1 ≤ *i*, *j* ≤ 2, of the covariance matrix Σ� of *X*� is

*ak* −

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

> *n*+*na* ∑ *k*=*n*+1

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*ij*,11 + *σ*�

*n* ∑ *k*=1

*n*+*na* ∑ *k*=*n*+1

3 ∑ *l*=1

*n* ∑ *k*=1

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

**Adding points**

*μ*� =

Let

*σ*� *ij* <sup>=</sup> <sup>1</sup> 12 *<sup>n</sup>* ∑ *k*=1

Let

where

*n* ∑ *k*=1 *w*� *<sup>k</sup>μ<sup>k</sup>* +

> *aμ* +

<sup>=</sup> <sup>1</sup> *a*� *a*� =

The center of gravity of *X*� is

Then, we can rewrite (43) as

3 ∑ *l*=1

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

> *σ*� *ij* <sup>=</sup> <sup>1</sup> <sup>12</sup> (*σ*�

3 ∑ *h*=1 *w*�

3 ∑ *l*=1

3 ∑ *h*=1 *w*�

> 3 ∑ *l*=1

3 ∑ *l*=1 *w*�

> *σ*� *ij*,11 =

*σ*� *ij*,21 =

*σ*� *ij*,12 =

3 ∑ *h*=1 *w*�

(*i*, *j*)-th component, *σ*�

1 12  *<sup>n</sup>*+*na* ∑ *k*=*n*+1

*n* ∑ *k*=1

*n*+*na* ∑ *k*=*n*+1

*n*+*na* ∑ *k*=*n*+1 *ak* +

*w*� *<sup>k</sup>μ<sup>k</sup>* −

*akμ<sup>k</sup>* −

*<sup>μ</sup><sup>a</sup>* <sup>=</sup> <sup>1</sup> *a*�

*n*+*na* ∑ *k*=*n*+1

*σ*� *ij*,11 = *n* ∑ *k*=1 3 ∑ *l*=1 3 ∑ *h*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>a</sup> <sup>a</sup>*� *<sup>μ</sup><sup>i</sup>* <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>a</sup> <sup>a</sup>*� *<sup>μ</sup><sup>j</sup>* <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*) = *n* ∑ *k*=1 3 ∑ *l*=1 3 ∑ *h*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup><sup>i</sup>* <sup>+</sup> *<sup>μ</sup>i*(<sup>1</sup> <sup>−</sup> *<sup>a</sup> <sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*) · (*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup><sup>j</sup>* <sup>+</sup> *<sup>μ</sup>j*(<sup>1</sup> <sup>−</sup> *<sup>a</sup> <sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*) = *n* ∑ *k*=1 3 ∑ *l*=1 3 ∑ *h*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) + *n* ∑ *k*=1 3 ∑ *l*=1 3 ∑ *h*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup>i*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>a</sup> <sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*) + *n* ∑ *k*=1 3 ∑ *l*=1 3 ∑ *h*=1 *w*� *<sup>k</sup>*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>a</sup> <sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup>j*) + *n* ∑ *k*=1 3 ∑ *l*=1 3 ∑ *h*=1 *w*� *<sup>k</sup>*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>a</sup> <sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>a</sup> <sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*). (51)

Since ∑*<sup>n</sup> <sup>k</sup>*=<sup>1</sup> <sup>∑</sup><sup>3</sup> *<sup>l</sup>*=<sup>1</sup> *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μi*) = 0, 1 ≤ *i* ≤ 2, we have

$$
\sigma\_{lj,11}' = \frac{1}{a'} \sum\_{k=1}^{n} \sum\_{l=1}^{3} \sum\_{h=1}^{3} a\_k (\mathbf{x}\_{iJ,k} - \mu\_i)(\mathbf{x}\_{jh,k} - \mu\_j) + 
$$

$$
\frac{1}{a'} \sum\_{k=1}^{n} \sum\_{l=1}^{3} \sum\_{h=1}^{3} a\_k (\mu\_i(1 - \frac{a}{a'}) - \mu\_{i,a} + \mu\_{i,d})(\mu\_j(1 - \frac{a}{a'}) - \mu\_{j,a} + \mu\_{j,d})
$$

$$
= \frac{1}{a'} \sum\_{k=1}^{n} \sum\_{l=1}^{3} \sum\_{h=1}^{3} a\_k (\mathbf{x}\_{iJ,k} - \mu\_i)(\mathbf{x}\_{jh,k} - \mu\_j) +
$$

$$
\begin{split}
\Phi \frac{a}{a'} (\mu\_i(1 - \frac{a}{a'}) - \mu\_{i,a} + \mu\_{i,d})(\mu\_j(1 - \frac{a}{a'}) - \mu\_{j,d} + \mu\_{j,d}).
\end{split} \tag{52}
$$

of Discrete and Continuous Point Sets 21

Computing and Updating Principal Components of Discrete and Continuous Point Sets 283

Let the new convex hull be obtained by deleting *nd* tetrahedra from and added *na* tetrahedra to the old convex hull. If the interior point*o*, after deleting points, lies inside the new convex hull, then the same formulas and time complexity, as by adding points, follow. However, *o* could lie outside the new convex hull. Then, we need to choose a new interior point *o*�

recompute the new tetrahedra associated with it. Thus, we need in total *O*(*n*) time to update

Let *X* be a polygon in **R**2. We assume that the boundary of *X* is comprised of *n* line segments. The *k*-th line segment, with vertices *x*1,*k*,*x*2,*k*, can be represented in a parametric form by

*Sk*(*t*) = *x*1,*<sup>k</sup>* + *t*(*x*2,*<sup>k</sup>* −*x*1,*k*). Since we assume that the mass density is constant, the center of gravity of the *k*-th line segment

The contribution of each line segment to the center of gravity of the boundary of a polygon is

*sk* = length(*Sk*) = ||*x*2,*<sup>k</sup>* −*x*1,*k*||.

proportional to the length of the line segment. The length of the *k*-th line segment is

We introduce a weight to each line segment that is proportional to its length, define as

*wk* <sup>=</sup> *sk* ∑*n <sup>k</sup>*=<sup>1</sup> *sk*

where *s* is the perimeter of *X*. Then, the center of gravity of the boundary of *X* is

*μ* =

*Sk*(*t*) <sup>−</sup>*<sup>μ</sup>*)*<sup>T</sup> dt*

(*xj*,*<sup>k</sup>* −*μ*)(*xh*,*<sup>k</sup>* −*μ*)

(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) +

*n* ∑ *k*=1

*wkμk*.

*<sup>T</sup>* + 2 ∑ *j*=1

> 2 ∑ *l*=1

(*xj*,*<sup>k</sup>* −*μ*)(*xj*,*<sup>k</sup>* −*μ*)

(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*l*,*<sup>k</sup>* − *μj*)

*T* .

> ,

<sup>0</sup> *dt* <sup>=</sup> *<sup>x</sup>*1,*<sup>k</sup>* <sup>+</sup>*<sup>x</sup>*2,*<sup>k</sup>*

<sup>=</sup> *sk s* ,

<sup>2</sup> .

, and

**Deleting points**

is

the principal components.

**6.3 Continuous PCA over the boundary of a polygon R**<sup>2</sup>

The covariance matrix of the *k*-th line segment is

*Sk*(*t*) <sup>−</sup>*<sup>μ</sup>*) (

2 ∑ *h*=1

2 ∑ *h*=1  1 <sup>0</sup> *dt*

 1 <sup>0</sup> (

<sup>=</sup> <sup>1</sup> 6 <sup>2</sup> ∑ *j*=1

The (*i*, *j*)-th element of Σ*k*, *i*, *j* ∈ {1, 2}, is

*<sup>σ</sup>ij*,*<sup>k</sup>* <sup>=</sup> <sup>1</sup> 6 <sup>2</sup> ∑ *l*=1

with *μ* = (*μ*1, *μ*2).

Σ*<sup>k</sup>* =

*μ<sup>k</sup>* =

 1 0 *Sk*(*t*) *dt* 1

Plugging-in the values of *μ*� *<sup>i</sup>* and *μ*� *<sup>j</sup>* in (46), we obtain:

$$
\begin{split}
\sigma'\_{j,12} &= \sum\_{k=1}^{n} \sum\_{l=1}^{3} w'\_k \left( \mathbf{x}\_{iJ,k} - \frac{a}{a'} \mu\_i - \mu\_{i,a} + \mu\_{i,d} \right) \left( \mathbf{x}\_{j,b,k} - \frac{a}{a'} \mu\_j - \mu\_{j,a} + \mu\_{j,d} \right) \\ &= \sum\_{k=1}^{n} \sum\_{l=1}^{3} w'\_k \left( \mathbf{x}\_{iJ,k} - \mu\_i + \mu\_i (1 - \frac{a}{a'}) - \mu\_{i,a} + \mu\_{i,d} \right) \\ & \quad \left( \mathbf{x}\_{jh,k} - \mu\_j + \mu\_j (1 - \frac{a}{a'}) - \mu\_{j,a} + \mu\_{j,d} \right) \\ &= \sum\_{k=1}^{n} \sum\_{l=1}^{3} w'\_k (\mathbf{x}\_{iJ,k} - \mu\_i) \left( \mathbf{x}\_{jh,k} - \mu\_j \right) + \\ & \quad \sum\_{k=1}^{n} \sum\_{l=1}^{3} w'\_k (\mathbf{x}\_{iJ,k} - \mu\_i) \left( \mu\_j (1 - \frac{a}{a'}) - \mu\_{j,a} + \mu\_{j,d} \right) + \\ & \quad \sum\_{k=1}^{n} \sum\_{l=1}^{3} w'\_k (\mu\_i (1 - \frac{a}{a'}) - \mu\_{i,a} + \mu\_{i,d}) (\mu\_j (1 - \frac{a}{a'}) - \mu\_{j,a} + \mu\_{j,d}). \tag{53} \end{split}
$$

Since ∑*<sup>n</sup> <sup>k</sup>*=<sup>1</sup> <sup>∑</sup><sup>3</sup> *<sup>l</sup>*=<sup>1</sup> *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μi*) = 0, 1 ≤ *i* ≤ 2, we have

$$\begin{split} \sigma\_{ij,12}' &= \frac{1}{a'} \sum\_{k=1}^{n} \sum\_{l=1}^{3} a\_k (\mathbf{x}\_{i,l,k} - \mu\_i)(\mathbf{x}\_{j,h,k} - \mu\_j) + \\ &\quad \frac{1}{a'} \sum\_{k=1}^{n} \sum\_{l=1}^{3} a\_k (\mu\_i(1 - \frac{a}{a'}) - \mu\_{i,a} + \mu\_{i,d})(\mu\_j(1 - \frac{a}{a'}) - \mu\_{j,a} + \mu\_{j,d}) \\ &= \frac{1}{a'} \sum\_{k=1}^{n} \sum\_{l=1}^{3} a\_k (\mathbf{x}\_{i,l,k} - \mu\_i)(\mathbf{x}\_{j,h,k} - \mu\_j) + \\ &\quad 3 \frac{a}{a'} (\mu\_i(1 - \frac{a}{a'}) - \mu\_{i,a} + \mu\_{i,d})(\mu\_j(1 - \frac{a}{a'}) - \mu\_{j,a} + \mu\_{j,d}). \end{split} \tag{54}$$

From (53) and (54), we obtain

$$
\sigma\_{ij,1}^{\prime} = \sigma\_{ij,11}^{\prime} + \sigma\_{ij,12}^{\prime} = \sigma\_{ij} + 12\frac{a}{a^{\prime}}(\mu\_i(1 - \frac{a}{a^{\prime}}) - \mu\_{i,a} + \mu\_{i,d})(\mu\_j(1 - \frac{a}{a^{\prime}}) - \mu\_{j,a} + \mu\_{j,d}).\tag{55}
$$

Note that *σ*� *ij*,1 can be computed in *O*(1) time. The components *σ*� *ij*,21 and *σ*� *ij*,22 can be computed in *O*(*na*) time, while *O*(*nd*) time is needed to compute *σ*� *ij*,31 and *σ*� *ij*,32. Thus, *<sup>μ</sup>*� and

$$
\begin{split}
\sigma'\_{ij} &= \frac{1}{12} (\sigma'\_{ij,11} + \sigma'\_{ij,12} + \sigma'\_{ij,21} + \sigma'\_{ij,22} + \sigma'\_{ij,31} + \sigma'\_{ij,32}) \\
&= \frac{1}{12} (\sigma\_{ij} + \sigma'\_{ij,21} + \sigma'\_{ij,22} + \sigma'\_{ij,31} + \sigma\_{ij,32}) + \\
&\quad \frac{a}{a'} (\mu\_i (1 - \frac{a}{a'}) - \mu\_{i,a} + \mu\_{i,d}) (\mu\_j (1 - \frac{a}{a'}) - \mu\_{j,a} + \mu\_{j,d}).
\end{split}
\tag{56}
$$

can be computed in *O*(*na* + *nd*) time.

#### **Deleting points**

20 Will-be-set-by-IN-TECH

*<sup>a</sup>*� *<sup>μ</sup><sup>i</sup>* <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>a</sup>*

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*) ·

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*)

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*) +

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup>j*) +

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*ij*,22 + *σ*�

*ij*,31 + *σij*,32) +

*ij*,31 and *σ*�

*ij*,31 + *σ*�

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*<sup>a</sup>*� *<sup>μ</sup><sup>j</sup>* <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*)

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*). (53)

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*)

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*). (54)

*ij*,32. Thus, *<sup>μ</sup>*� and

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*). (56)

*ij*,21 and *σ*�

*ij*,32)

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*). (55)

*ij*,22 can be computed

*<sup>j</sup>* in (46), we obtain:

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup><sup>i</sup>* <sup>+</sup> *<sup>μ</sup>i*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup><sup>j</sup>* <sup>+</sup> *<sup>μ</sup>j*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) +

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup>i*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*<sup>k</sup>*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*<sup>k</sup>*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μi*) = 0, 1 ≤ *i* ≤ 2, we have

*ak*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*ak*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) +

*ak*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) +

*<sup>a</sup>*� (*μi*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*ij*,12 + *σ*�

*ij*,21 + *σ*�

*ij*,21 + *σ*�

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*ij*,22 + *σ*�

*ij*,1 can be computed in *O*(1) time. The components *σ*�

*<sup>a</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*<sup>i</sup>* and *μ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>a</sup>*

Plugging-in the values of *μ*�

*n* ∑ *k*=1

= *n* ∑ *k*=1

= *n* ∑ *k*=1

> *n* ∑ *k*=1

> *n* ∑ *k*=1

> *n* ∑ *k*=1

> > 1 *a*�

<sup>=</sup> <sup>1</sup> *a*�

3 *a*

3 ∑ *l*=1 *w*�

3 ∑ *l*=1 *w*�

3 ∑ *l*=1 *w*�

3 ∑ *l*=1 *w*�

3 ∑ *l*=1 *w*�

3 ∑ *l*=1 *w*�

*n* ∑ *k*=1

*n* ∑ *k*=1

*n* ∑ *k*=1

3 ∑ *l*=1

3 ∑ *l*=1

3 ∑ *l*=1

*<sup>a</sup>*� (*μi*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*ij*,12 <sup>=</sup> *<sup>σ</sup>ij* <sup>+</sup> <sup>12</sup> *<sup>a</sup>*

in *O*(*na*) time, while *O*(*nd*) time is needed to compute *σ*�

<sup>12</sup> (*σij* <sup>+</sup> *<sup>σ</sup>*�

*<sup>a</sup>*� (*μi*(<sup>1</sup> <sup>−</sup> *<sup>a</sup>*

*ij*,11 + *σ*�

*σ*� *ij*,12 =

Since ∑*<sup>n</sup>*

*σ*� *ij*,1 = *σ*�

Note that *σ*�

*<sup>k</sup>*=<sup>1</sup> <sup>∑</sup><sup>3</sup>

*σ*� *ij*,12 <sup>=</sup> <sup>1</sup> *a*�

From (53) and (54), we obtain

*ij*,11 + *σ*�

*σ*� *ij* <sup>=</sup> <sup>1</sup> <sup>12</sup> (*σ*�

can be computed in *O*(*na* + *nd*) time.

<sup>=</sup> <sup>1</sup>

*a*

*<sup>l</sup>*=<sup>1</sup> *w*�

Let the new convex hull be obtained by deleting *nd* tetrahedra from and added *na* tetrahedra to the old convex hull. If the interior point*o*, after deleting points, lies inside the new convex hull, then the same formulas and time complexity, as by adding points, follow. However, *o* could lie outside the new convex hull. Then, we need to choose a new interior point *o*� , and recompute the new tetrahedra associated with it. Thus, we need in total *O*(*n*) time to update the principal components.

#### **6.3 Continuous PCA over the boundary of a polygon R**<sup>2</sup>

Let *X* be a polygon in **R**2. We assume that the boundary of *X* is comprised of *n* line segments. The *k*-th line segment, with vertices *x*1,*k*,*x*2,*k*, can be represented in a parametric form by

$$
\vec{S}\_k(t) = \vec{x}\_{1,k} + t \left( \vec{x}\_{2,k} - \vec{x}\_{1,k} \right).
$$

Since we assume that the mass density is constant, the center of gravity of the *k*-th line segment is

$$
\vec{\mu}\_k = \frac{\int\_0^1 \vec{S}\_k(t) \, dt}{\int\_0^1 \, dt} = \frac{\vec{x}\_{1,k} + \vec{x}\_{2,k}}{2}.
$$

The contribution of each line segment to the center of gravity of the boundary of a polygon is proportional to the length of the line segment. The length of the *k*-th line segment is

$$s\_k = \text{length}(\mathcal{S}\_k) = ||\vec{x}\_{2,k} - \vec{x}\_{1,k}||.$$

We introduce a weight to each line segment that is proportional to its length, define as

$$w\_k = \frac{s\_k}{\sum\_{k=1}^n s\_k} = \frac{s\_k}{s}.$$

where *s* is the perimeter of *X*. Then, the center of gravity of the boundary of *X* is

$$
\vec{\mu} = \sum\_{k=1}^{n} w\_k \vec{\mu}\_k.
$$

The covariance matrix of the *k*-th line segment is

$$\begin{split} \Sigma\_{k} &= \frac{\int\_{0}^{1} \left( \vec{\mathcal{S}}\_{k}(t) - \vec{\mu} \right) \left( \vec{\mathcal{S}}\_{k}(t) - \vec{\mu} \right)^{T} dt}{\int\_{0}^{1} dt} \\ &= \frac{1}{6} \Big( \sum\_{j=1}^{2} \sum\_{h=1}^{2} (\vec{\mathcal{X}}\_{j,k} - \vec{\mu}) (\vec{\mathcal{X}}\_{h,k} - \vec{\mu})^{T} + \sum\_{j=1}^{2} (\vec{\mathcal{X}}\_{j,k} - \vec{\mu}) (\vec{\mathcal{X}}\_{j,k} - \vec{\mu})^{T} \Big). \end{split}$$

The (*i*, *j*)-th element of Σ*k*, *i*, *j* ∈ {1, 2}, is

$$
\sigma\_{ij,k} = \frac{1}{6} \left( \sum\_{l=1}^{2} \sum\_{h=1}^{2} (\mathbf{x}\_{iJ,k} - \boldsymbol{\mu}\_{i})(\mathbf{x}\_{jh,k} - \boldsymbol{\mu}\_{j}) + \sum\_{l=1}^{2} (\mathbf{x}\_{iJ,k} - \boldsymbol{\mu}\_{i})(\mathbf{x}\_{jJ,k} - \boldsymbol{\mu}\_{j}) \right),
$$

with *μ* = (*μ*1, *μ*2).

Let

where

*σ*� *ij* <sup>=</sup> <sup>1</sup> 6 (*σ*� *ij*,11 + *σ*�

> *σ*� *ij*,11 =

*σ*� *ij*,21 =

*σ*� *ij*,31 =

Plugging-in the values of *μ*�

*n* ∑ *k*=1

= *n* ∑ *k*=1

= *n* ∑ *k*=1

> *n* ∑ *k*=1

> *n* ∑ *k*=1

> *n* ∑ *k*=1

2 ∑ *l*=1

2 ∑ *l*=1

2 ∑ *l*=1

2 ∑ *l*=1

2 ∑ *l*=1

2 ∑ *l*=1

2 ∑ *h*=1 *w*�

2 ∑ *h*=1 *w*�

2 ∑ *h*=1 *w*�

2 ∑ *h*=1 *w*�

2 ∑ *h*=1 *w*�

2 ∑ *h*=1 *w*�

*σ*� *ij*,11 = *σ*� *ij*,32 =

*σ*� *ij*,22 =

*σ*� *ij*,12 =

*n* ∑ *k*=1

*n*+*na* ∑ *k*=*n*+1

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

*<sup>i</sup>* and *μ*�

2 ∑ *l*=1

*n* ∑ *k*=1

*n*+*na* ∑ *k*=*n*+1

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>s</sup>*

of Discrete and Continuous Point Sets 23

Computing and Updating Principal Components of Discrete and Continuous Point Sets 285

*ij*,21 + *σ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>s</sup>*� *<sup>μ</sup><sup>i</sup>* <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>s</sup>*

*ij*,22 − *σ*�

*ij*,31 − *σ*�

*j*

*j*

*j*

*j*

*j*

*<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*�

*<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*�

*<sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*) ·

*<sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*)

*<sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*) +

*<sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup>j*) +

*<sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>s</sup>*

*j*

*<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*�

*<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*�

*<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*�

*<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*�

*ij*,32),

), (59)

), (60)

), (61)

), (62)

), (63)

). (64)

*<sup>s</sup>*� *<sup>μ</sup><sup>j</sup>* <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*)

*<sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*). (65)

*ij*,12 + *σ*�

2 ∑ *h*=1 *w*�

2 ∑ *l*=1 *w*�

2 ∑ *l*=1

2 ∑ *h*=1 *w*�

2 ∑ *l*=1 *w*�

2 ∑ *l*=1

2 ∑ *h*=1 *w*�

3 ∑ *l*=1 *w*�

*<sup>j</sup>* in (59), we obtain:

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup><sup>i</sup>* <sup>+</sup> *<sup>μ</sup>i*(<sup>1</sup> <sup>−</sup> *<sup>s</sup>*

(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup><sup>j</sup>* <sup>+</sup> *<sup>μ</sup>j*(<sup>1</sup> <sup>−</sup> *<sup>s</sup>*

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) +

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup>i*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>s</sup>*

*<sup>k</sup>*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>s</sup>*

*<sup>k</sup>*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>s</sup>*

The covariance matrix of the boundary of *X* is

$$
\Sigma = \sum\_{k=1}^{n} w\_k \Sigma\_k.
$$

#### **Adding points**

We add points to *X*. Let *X*� be the new convex hull. We assume that *X*� is obtained from *X* by deleting *nd*, and adding *na* line segments. Then the sum of the lengths of all line segments is

$$s' = \sum\_{k=1}^{n} l\_k + \sum\_{k=n+1}^{n+n\_d} s\_k - \sum\_{k=n+n\_d+1}^{n+n\_d+n\_d} s\_k = s + \sum\_{k=n+1}^{n+n\_d} s\_k - \sum\_{k=n+n\_d+1}^{n+n\_d+n\_d} s\_k.$$

The center of gravity of *X*� is

$$\overrightarrow{\mu}' = \sum\_{k=1}^{n} w\_k' \overrightarrow{\mu}\_k + \sum\_{k=n+1}^{n+n\_a} w\_k' \overrightarrow{\mu}\_k - \sum\_{k=n+n\_a+1}^{n+n\_a+n\_d} w\_k' \overrightarrow{\mu}\_k$$

$$= \frac{1}{s'} \left( \sum\_{k=1}^{n} s\_k \overrightarrow{\mu}\_k + \sum\_{k=n+1}^{n+n\_a} s\_k \overrightarrow{\mu}\_k - \sum\_{k=n+n\_a+1}^{n+n\_a+n\_d} s\_k \overrightarrow{\mu}\_k \right)$$

$$= \frac{1}{s'} \left( s \overrightarrow{\mu} + \sum\_{k=n+1}^{n+n\_a} s\_k \overrightarrow{\mu}\_k - \sum\_{k=n+n\_a+1}^{n+n\_a+n\_d} s\_k \overrightarrow{\mu}\_k \right). \tag{57}$$

Let

$$
\overrightarrow{\mu}\_d = \frac{1}{\text{s}'} \sum\_{k=n+1}^{n+n\_d} s\_k \overrightarrow{\mu}\_{k'} \quad \text{and} \quad \overrightarrow{\mu}\_d = \frac{1}{\text{s}'} \sum\_{k=n+n\_d+1}^{n+n\_d+n\_d} s\_k \overrightarrow{\mu}\_{k'}.
$$

Then, we can rewrite (57) as

$$
\vec{\mu}' = \frac{s}{s'}\vec{\mu} + \vec{\mu}\_a - \vec{\mu}\_d.\tag{58}
$$

The *i*-th component of *μ<sup>a</sup>* and *μd*, 1 ≤ *i* ≤ 2, is denoted by *μi*,*<sup>a</sup>* and *μi*,*d*, respectively. The (*i*, *j*)-th component, *σ*� *ij*, 1 ≤ *i*, *j* ≤ 2, of the covariance matrix Σ� of *X*� is

$$
\sigma\_{ij}' = \frac{1}{6} \left( \sum\_{k=1}^{n} \sum\_{l=1}^{2} \sum\_{h=1}^{2} w\_k'(\mathbf{x}\_{i,l,k} - \mu\_i')(\mathbf{x}\_{j,h,k} - \mu\_j') + \sum\_{k=1}^{n} \sum\_{l=1}^{2} w\_k'(\mathbf{x}\_{i,l,k} - \mu\_i')(\mathbf{x}\_{j,l,k} - \mu\_j') \right) + 
$$

$$
\frac{1}{6} \left( \sum\_{k=n+1}^{n+u\_n} \sum\_{l=1}^{2} \sum\_{h=1}^{2} w\_k'(\mathbf{x}\_{i,l,k} - \mu\_i')(\mathbf{x}\_{j,h,k} - \mu\_j') + \sum\_{k=n+1}^{n+u\_n} \sum\_{l=1}^{2} w\_k'(\mathbf{x}\_{i,l,k} - \mu\_i')(\mathbf{x}\_{j,l,k} - \mu\_j') - \mu\_j' \right) - 
$$

$$
\sum\_{k=n+u\_n+1}^{n+u\_n+u\_n} \sum\_{l=1}^{2} \sum\_{h=1}^{2} w\_k'(\mathbf{x}\_{i,l,k} - \mu\_i')(\mathbf{x}\_{j,h,k} - \mu\_j') - 
$$

$$
\sum\_{k=n+u\_n+1}^{n+u\_n+u\_n} \sum\_{l=1}^{2} w\_k'(\mathbf{x}\_{i,l,k} - \mu\_i')(\mathbf{x}\_{j,l,k} - \mu\_j') \Big).
$$

Let

22 Will-be-set-by-IN-TECH

*n* ∑ *k*=1

We add points to *X*. Let *X*� be the new convex hull. We assume that *X*� is obtained from *X* by deleting *nd*, and adding *na* line segments. Then the sum of the lengths of all line segments is

*wk*Σ*k*.

*sk* = *s* +

*skμ<sup>k</sup>* −

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

*s*�

2 ∑ *l*=1 *w*�

*n*+*na* ∑ *k*=*n*+1

> *j* ) −

2 ∑ *l*=1 *w*�

*n*+*na* ∑ *k*=*n*+1

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1 *sk* −

*w*� *<sup>k</sup>μ<sup>k</sup>*

> *skμ<sup>k</sup>*

> > *skμk*.

*μ* +*μ<sup>a</sup>* −*μd*. (58)

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*�

*j* ) +

*<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*�

*j* ) −

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

> *skμ<sup>k</sup>*

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

*sk*.

. (57)

Σ =

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

*n*+*na* ∑ *k*=*n*+1

*skμ<sup>k</sup>* +

*n*+*na* ∑ *k*=*n*+1

*<sup>μ</sup>*� <sup>=</sup> *<sup>s</sup> s*�

*<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*�

*<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*�

*<sup>i</sup>*)(*xj*,*l*,*<sup>k</sup>* − *μ*�

*w*� *<sup>k</sup>μ<sup>k</sup>* −

*n*+*na* ∑ *k*=*n*+1

*skμ<sup>k</sup>* −

*sk<sup>μ</sup>k*, and *<sup>μ</sup><sup>d</sup>* <sup>=</sup> <sup>1</sup>

The *i*-th component of *μ<sup>a</sup>* and *μd*, 1 ≤ *i* ≤ 2, is denoted by *μi*,*<sup>a</sup>* and *μi*,*d*, respectively. The

*j* ) + *n* ∑ *k*=1

> *j* ) +

*<sup>i</sup>*)(*xj*,*h*,*<sup>k</sup>* − *μ*�

*j* ) .

*ij*, 1 ≤ *i*, *j* ≤ 2, of the covariance matrix Σ� of *X*� is

The covariance matrix of the boundary of *X* is

*n*+*na* ∑ *k*=*n*+1

*n* ∑ *k*=1 *w*� *<sup>k</sup>μ<sup>k</sup>* +

> *n* ∑ *k*=1

 *sμ* +

*n*+*na* ∑ *k*=*n*+1

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μ*�

<sup>=</sup> <sup>1</sup> *s*�

<sup>=</sup> <sup>1</sup> *s*�

*<sup>μ</sup><sup>a</sup>* <sup>=</sup> <sup>1</sup> *s*�

*μ*� =

*sk* −

**Adding points**

Let

*σ*� *ij* <sup>=</sup> <sup>1</sup> 6 *<sup>n</sup>* ∑ *k*=1

*s* � = *n* ∑ *k*=1 *lk* +

The center of gravity of *X*� is

Then, we can rewrite (57) as

2 ∑ *l*=1

2 ∑ *h*=1 *w*�

2 ∑ *l*=1

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

*n*+*na*+*nd* ∑ *k*=*n*+*na*+1

2 ∑ *h*=1 *w*�

> 2 ∑ *l*=1

2 ∑ *l*=1 *w*�

2 ∑ *h*=1 *w*�

(*i*, *j*)-th component, *σ*�

1 6  *<sup>n</sup>*+*na* ∑ *k*=*n*+1

$$
\sigma'\_{ij} = \frac{1}{6} (\sigma'\_{ij,11} + \sigma'\_{ij,12} + \sigma'\_{ij,21} + \sigma'\_{ij,22} - \sigma'\_{ij,31} - \sigma'\_{ij,32}) / \sigma
$$

where

$$\sigma\_{ij,11}' = \sum\_{k=1}^{n} \sum\_{l=1}^{2} \sum\_{h=1}^{2} w\_k'(\mathbf{x}\_{i,l,k} - \mu\_i')(\mathbf{x}\_{j,h,k} - \mu\_j'),\tag{59}$$

$$
\sigma\_{ij,12}' = \sum\_{k=1}^{n} \sum\_{l=1}^{2} w\_k'(\mathbf{x}\_{i,l,k} - \mu\_i')(\mathbf{x}\_{j,l,k} - \mu\_j'),
\tag{60}
$$

$$\sigma\_{ij,21}' = \sum\_{k=n+1}^{n+n\_a} \sum\_{l=1}^{2} \sum\_{h=1}^{2} w\_k'(\mathbf{x}\_{i,l,k} - \mu\_i')(\mathbf{x}\_{j,h,k} - \mu\_j'),\tag{61}$$

$$\sigma\_{ij,22}' = \sum\_{k=n+1}^{n+n\_d} \sum\_{l=1}^{2} w\_k'(\mathbf{x}\_{i,l,k} - \mu\_i')(\mathbf{x}\_{j,l,k} - \mu\_j'),\tag{62}$$

$$
\sigma'\_{ij,31} = \sum\_{k=n+n\_d+1}^{n+n\_d+n\_d} \sum\_{l=1}^2 \sum\_{h=1}^2 w'\_k(\mathbf{x}\_{i,l,k} - \mu'\_i)(\mathbf{x}\_{j,h,k} - \mu'\_j),
\tag{63}
$$

$$\sigma\_{ij,32}' = \sum\_{k=n+n\_d+1}^{n+n\_d+n\_d} \sum\_{l=1}^3 w\_k'(\mathbf{x}\_{i,l,k} - \mu\_i')(\mathbf{x}\_{j,l,k} - \mu\_j'). \tag{64}$$

Plugging-in the values of *μ*� *<sup>i</sup>* and *μ*� *<sup>j</sup>* in (59), we obtain:

*σ*� *ij*,11 = *n* ∑ *k*=1 2 ∑ *l*=1 2 ∑ *h*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>s</sup> <sup>s</sup>*� *<sup>μ</sup><sup>i</sup>* <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>s</sup> <sup>s</sup>*� *<sup>μ</sup><sup>j</sup>* <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*) = *n* ∑ *k*=1 2 ∑ *l*=1 2 ∑ *h*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup><sup>i</sup>* <sup>+</sup> *<sup>μ</sup>i*(<sup>1</sup> <sup>−</sup> *<sup>s</sup> <sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*) · (*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup><sup>j</sup>* <sup>+</sup> *<sup>μ</sup>j*(<sup>1</sup> <sup>−</sup> *<sup>s</sup> <sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*) = *n* ∑ *k*=1 2 ∑ *l*=1 2 ∑ *h*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) + *n* ∑ *k*=1 2 ∑ *l*=1 2 ∑ *h*=1 *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup>i*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>s</sup> <sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*) + *n* ∑ *k*=1 2 ∑ *l*=1 2 ∑ *h*=1 *w*� *<sup>k</sup>*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>s</sup> <sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup>j*) + *n* ∑ *k*=1 2 ∑ *l*=1 2 ∑ *h*=1 *w*� *<sup>k</sup>*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>s</sup> <sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>s</sup> <sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*). (65)

of Discrete and Continuous Point Sets 25

Computing and Updating Principal Components of Discrete and Continuous Point Sets 287

*ij*,21 + *σ*�

*<sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>s</sup>*

Let the new convex hull be obtained by deleting *nd* tetrahedra from and added *na* tetrahedra to the old convex hull. Consequently, the same formulas and time complexity, as by adding

Chan, T. F., Golub, G. H. & LeVeque, R. J. (1979). Updating formulae and a pairwise algorithm

Cheng, S.-W. & Y. Wang, Z. W. (2008). Provable dimension detection using principal

Dimitrov, D., Holst, M., Knauer, C. & Kriegel, K. (2009). Closed-form solutions for continuous

Dimitrov, D., Holst, M., Knauer, C. & Kriegel, K. (2011). Efficient dynamical computation

Dimitrov, D., Knauer, C., Kriegel, K. & Rote, G. (2009). Bounds on the quality of the PCA

Knuth, D. E. (1998). *The art of computer programming, volume 2: seminumerical algorithms*,

Parlett, B. N. (1998). *The symmetric eigenvalue problem*, Society of Industrial and Applied

Duda, R., Hart, P. & Stork, D. (2001). *Pattern classification*, John Wiley & Sons, Inc., 2nd ed. Gottschalk, S., Lin, M. C. & Manocha, D. (1996). OBBTree: A hierarchical structure for rapid

Jolliffe, I. (2002). *Principal Component Analysis*, Springer-Verlag, New York, 2nd ed.

component analysis, *Int. J. Comput. Geometry Appl.* 18: 415–440.

for computing sample variances, *Technical Report STAN-CS-79-773*, Department of

PCA and bounding box algorithms, *A. Ranchordas et al. (Eds.): VISIGRAPP 2008,*

of principal components, *Proceedings of International Conference on Computer Graphics*

*ij*,22 + *σ*�

*<sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>s</sup>*

*ij*,22 + *σ*�

*ij*,31 + *σij*,32) +

*<sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*). (69)

*ij*,32. Thus, *<sup>μ</sup>*� and

*<sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*) (70)

*ij*,22 can be computed

*ij*,21 and *σ*�

*ij*,32)

*ij*,31 and *σ*�

*ij*,31 + *σ*�

*σ*� *ij*,1 = *σ*�

Note that *σ*�

**Deleting points**

points, follow.

**7. References**

*ij*,11 + *σ*�

in *O*(*na*) time, while *O*(*nd*) time is needed to compute *σ*�

(*σij* + *σ*�

*<sup>s</sup>*� (*μi*(<sup>1</sup> <sup>−</sup> *<sup>s</sup>*

Computer Science, Stanford University.

*Theory and Applications - GRAPP*, pp. 85–93.

Addison-Wesley, Boston, 3rd ed.

Mathematics (SIAM), Philadelphia, PA.

bounding boxes, *Computational Geometry* 42: 772–789.

interference detection, *Computer Graphics* 30: 171–180.

*CCIS, Springer* 24: 26–40.

<sup>=</sup> *<sup>σ</sup>ij* <sup>+</sup> <sup>6</sup> *<sup>s</sup>*

*σ*� *ij* <sup>=</sup> <sup>1</sup> 6 (*σ*� *ij*,11 + *σ*�

can be computed in *O*(*na* + *nd*) time.

<sup>=</sup> <sup>1</sup> 6

*s*

*ij*,12

*<sup>s</sup>*� (*μi*(<sup>1</sup> <sup>−</sup> *<sup>s</sup>*

*ij*,1 can be computed in *O*(1) time. The components *σ*�

*ij*,12 + *σ*�

*ij*,21 + *σ*�

Since ∑*<sup>n</sup> <sup>k</sup>*=<sup>1</sup> <sup>∑</sup><sup>2</sup> *<sup>l</sup>*=<sup>1</sup> *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μi*) = 0, 1 ≤ *i* ≤ 2, we have

$$\begin{split} \sigma\_{ij,11}' &= \frac{1}{s'} \sum\_{k=1}^{n} \sum\_{l=1}^{2} \sum\_{h=1}^{2} s\_k (\mathbf{x}\_{i,l,k} - \boldsymbol{\mu}\_i)(\mathbf{x}\_{j,h,k} - \boldsymbol{\mu}\_j) + \\ &\quad \frac{1}{s'} \sum\_{k=1}^{n} \sum\_{l=1}^{2} \sum\_{h=1}^{2} s\_k (\mu\_i(1 - \frac{s}{s'}) - \mu\_{i,a} + \mu\_{i,d})(\mu\_j(1 - \frac{s}{s'}) - \mu\_{j,a} + \mu\_{j,d}) \\ &= \frac{1}{s'} \sum\_{k=1}^{n} \sum\_{l=1}^{2} \sum\_{l=1}^{2} s\_k (\mathbf{x}\_{i,l,k} - \boldsymbol{\mu}\_i)(\mathbf{x}\_{j,h,k} - \boldsymbol{\mu}\_j) + \\ &\quad \mathbf{4} \frac{s}{s'} (\mu\_i(1 - \frac{s}{s'}) - \mu\_{i,a} + \mu\_{i,d})(\mu\_j(1 - \frac{s}{s'}) - \mu\_{j,a} + \mu\_{j,d}). \tag{66} \end{split}$$

Plugging-in the values of *μ*� *<sup>i</sup>* and *μ*� *<sup>j</sup>* in (60), we obtain:

$$\begin{split} \mathcal{L}\_{j|j,1}^{\mu} &= \sum\_{k=1}^{n} \sum\_{l=1}^{2} w\_{k}^{l} (\mathbf{x}\_{i,l,k} - \frac{s}{s} \mu\_{i} - \mu\_{i,d} + \mu\_{i,d}) (\mathbf{x}\_{j,h,k} - \frac{s}{s'} \mu\_{j} - \mu\_{j,d} + \mu\_{j,d}) \\ &= \sum\_{k=1}^{n} \sum\_{l=1}^{2} w\_{k}^{l} (\mathbf{x}\_{i,l,k} - \mu\_{i} + \mu\_{i} (1 - \frac{s}{s'}) - \mu\_{i,d} + \mu\_{j,d}) \\ & \qquad \qquad (\mathbf{x}\_{j,h,k} - \mu\_{j} + \mu\_{j} (1 - \frac{s}{s'}) - \mu\_{j,d} + \mu\_{j,d}) \\ &= \sum\_{k=1}^{n} \sum\_{l=1}^{2} w\_{k}^{l} (\mathbf{x}\_{i,l,k} - \mu\_{i}) (\mathbf{x}\_{j,h,k} - \mu\_{j}) + \\ & \qquad \sum\_{k=1}^{n} \sum\_{l=1}^{2} w\_{k}^{l} (\mathbf{x}\_{i,l,k} - \mu\_{i}) (\mu\_{j} (1 - \frac{s}{s'}) - \mu\_{j,d} + \mu\_{j,d}) + \\ & \qquad \sum\_{k=1}^{n} \sum\_{l=1}^{2} w\_{k}^{l} (\mu\_{l} (1 - \frac{s}{s'}) - \mu\_{i,d} + \mu\_{i,d}) (\mu\_{j} (1 - \frac{s}{s'}) - \mu\_{j,d} + \mu\_{j,d}). \tag{67} \end{split}$$

Since ∑*<sup>n</sup> <sup>k</sup>*=<sup>1</sup> <sup>∑</sup><sup>2</sup> *<sup>l</sup>*=<sup>1</sup> *w*� *<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μi*) = 0, 1 ≤ *i* ≤ 2, we have

$$\begin{split} \boldsymbol{\mu}\_{ij,12}^{\prime} &= \frac{1}{\boldsymbol{s}^{\prime}} \sum\_{k=1}^{n} \sum\_{l=1}^{2} s\_{k} (\boldsymbol{x}\_{i,l,k} - \boldsymbol{\mu}\_{i}) (\boldsymbol{x}\_{j,h,k} - \boldsymbol{\mu}\_{j}) + \\ & \quad \frac{1}{\boldsymbol{s}^{\prime}} \sum\_{k=1}^{n} \sum\_{l=1}^{2} s\_{k} (\boldsymbol{\mu}\_{i} (1 - \frac{s}{\boldsymbol{s}^{\prime}}) - \boldsymbol{\mu}\_{i,a} + \boldsymbol{\mu}\_{i,d}) (\boldsymbol{\mu}\_{j} (1 - \frac{s}{\boldsymbol{s}^{\prime}}) - \boldsymbol{\mu}\_{j,a} + \boldsymbol{\mu}\_{j,d}) \\ & \quad = \frac{1}{\boldsymbol{s}^{\prime}} \sum\_{k=1}^{n} \sum\_{l=1}^{2} s\_{k} (\boldsymbol{x}\_{i,l,k} - \boldsymbol{\mu}\_{i}) (\boldsymbol{x}\_{j,h,k} - \boldsymbol{\mu}\_{j}) + \\ & \quad 2 \frac{s^{\prime}}{\boldsymbol{s}^{\prime}} (\boldsymbol{\mu}\_{i} (1 - \frac{s}{\boldsymbol{s}^{\prime}}) - \boldsymbol{\mu}\_{i,d} + \boldsymbol{\mu}\_{i,d}) (\boldsymbol{\mu}\_{j} (1 - \frac{s}{\boldsymbol{s}^{\prime}}) - \boldsymbol{\mu}\_{j,a} + \boldsymbol{\mu}\_{j,d}). \end{split} \tag{68}$$

From (67) and (68), we obtain

$$\begin{split} \sigma\_{ij,1}^{\prime} &= \sigma\_{ij,11}^{\prime} + \sigma\_{ij,12}^{\prime} \\ &= \sigma\_{ij} + 6\frac{s}{s^{\prime}}(\mu\_{i}(1 - \frac{s}{s^{\prime}}) - \mu\_{i,a} + \mu\_{i,d})(\mu\_{j}(1 - \frac{s}{s^{\prime}}) - \mu\_{j,a} + \mu\_{j,d}). \end{split} \tag{69}$$

Note that *σ*� *ij*,1 can be computed in *O*(1) time. The components *σ*� *ij*,21 and *σ*� *ij*,22 can be computed in *O*(*na*) time, while *O*(*nd*) time is needed to compute *σ*� *ij*,31 and *σ*� *ij*,32. Thus, *<sup>μ</sup>*� and

$$\begin{split} \sigma'\_{ij} &= \frac{1}{6} (\sigma'\_{ij,11} + \sigma'\_{ij,12} + \sigma'\_{ij,21} + \sigma'\_{ij,22} + \sigma'\_{ij,31} + \sigma'\_{ij,32}) \\ &= \frac{1}{6} (\sigma\_{ij} + \sigma'\_{ij,21} + \sigma'\_{ij,22} + \sigma'\_{ij,31} + \sigma\_{ij,32}) + \\ &\overset{\text{s}}{\underset{\mathbf{s'}}{\mathbf{s}'}} (\mu\_{i}(1 - \frac{\mathbf{s}}{\mathbf{s'}}) - \mu\_{i,a} + \mu\_{i,d})(\mu\_{j}(1 - \frac{\mathbf{s}}{\mathbf{s'}}) - \mu\_{j,a} + \mu\_{j,d}) \end{split} \tag{70}$$

can be computed in *O*(*na* + *nd*) time.

#### **Deleting points**

24 Will-be-set-by-IN-TECH

*sk*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) +

*sk*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) +

*<sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>s</sup>*

*<sup>j</sup>* in (60), we obtain:

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup><sup>i</sup>* <sup>+</sup> *<sup>μ</sup>i*(<sup>1</sup> <sup>−</sup> *<sup>s</sup>*

(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup><sup>j</sup>* <sup>+</sup> *<sup>μ</sup>j*(<sup>1</sup> <sup>−</sup> *<sup>s</sup>*

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) +

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup>i*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>s</sup>*

*<sup>k</sup>*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>s</sup>*

*<sup>k</sup>*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>s</sup>*

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μi*) = 0, 1 ≤ *i* ≤ 2, we have

*sk*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>s</sup>*

*sk*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) +

*sk*(*xi*,*l*,*<sup>k</sup>* − *μi*)(*xj*,*h*,*<sup>k</sup>* − *μj*) +

*<sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>s</sup>*

*<sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>s</sup>*

*<sup>s</sup>*� *<sup>μ</sup><sup>i</sup>* <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>s</sup>*

*<sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*) ·

*<sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*)

*<sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*) +

*<sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*xj*,*h*,*<sup>k</sup>* <sup>−</sup> *<sup>μ</sup>j*) +

*<sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>s</sup>*

*<sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>i*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>i*,*d*)(*μj*(<sup>1</sup> <sup>−</sup> *<sup>s</sup>*

*<sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*)

*<sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*). (66)

*<sup>s</sup>*� *<sup>μ</sup><sup>j</sup>* <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*)

*<sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*). (67)

*<sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*)

*<sup>s</sup>*� ) <sup>−</sup> *<sup>μ</sup>j*,*<sup>a</sup>* <sup>+</sup> *<sup>μ</sup>j*,*d*). (68)

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* − *μi*) = 0, 1 ≤ *i* ≤ 2, we have

*sk*(*μi*(<sup>1</sup> <sup>−</sup> *<sup>s</sup>*

Since ∑*<sup>n</sup>*

Since ∑*<sup>n</sup>*

*<sup>k</sup>*=<sup>1</sup> <sup>∑</sup><sup>2</sup>

*<sup>l</sup>*=<sup>1</sup> *w*�

*σ*� *ij*,12 <sup>=</sup> <sup>1</sup> *s*�

From (67) and (68), we obtain

*<sup>k</sup>*=<sup>1</sup> <sup>∑</sup><sup>2</sup>

*σ*� *ij*,11 <sup>=</sup> <sup>1</sup> *s*�

*<sup>l</sup>*=<sup>1</sup> *w*�

*n* ∑ *k*=1

*n* ∑ *k*=1

*n* ∑ *k*=1

1 *s*�

<sup>=</sup> <sup>1</sup> *s*�

Plugging-in the values of *μ*�

*σ*� *ij*,12 =

4 *s*

*n* ∑ *k*=1

= *n* ∑ *k*=1

= *n* ∑ *k*=1

> *n* ∑ *k*=1

> *n* ∑ *k*=1

> *n* ∑ *k*=1

> > 1 *s*�

<sup>=</sup> <sup>1</sup> *s*�

2 *s*

2 ∑ *l*=1

2 ∑ *l*=1

2 ∑ *l*=1

*<sup>s</sup>*� (*μi*(<sup>1</sup> <sup>−</sup> *<sup>s</sup>*

2 ∑ *l*=1 *w*�

2 ∑ *l*=1 *w*�

2 ∑ *l*=1 *w*�

2 ∑ *l*=1 *w*�

2 ∑ *l*=1 *w*�

2 ∑ *l*=1 *w*�

*n* ∑ *k*=1

*n* ∑ *k*=1

*n* ∑ *k*=1

2 ∑ *l*=1

2 ∑ *l*=1

2 ∑ *l*=1

*<sup>s</sup>*� (*μi*(<sup>1</sup> <sup>−</sup> *<sup>s</sup>*

2 ∑ *h*=1

2 ∑ *h*=1

2 ∑ *h*=1

*<sup>i</sup>* and *μ*�

*<sup>k</sup>*(*xi*,*l*,*<sup>k</sup>* <sup>−</sup> *<sup>s</sup>*

Let the new convex hull be obtained by deleting *nd* tetrahedra from and added *na* tetrahedra to the old convex hull. Consequently, the same formulas and time complexity, as by adding points, follow.

#### **7. References**


26 Will-be-set-by-IN-TECH

288 Principal Component Analysis

Pébay, P. P. (2008). Formulas for robust, one-pass parallel computation of covariances

Press, W. H., Teukolsky, S. A., Veterling, W. T. & Flannery, B. P. (1995). *Numerical recipes in C: the art of scientific computing*, Cambridge University Press, New York, USA, 2nd ed. Vrani´c, D. V., Saupe, D. & Richter, J. (2001). Tools for 3D-object retrieval: Karhunen-Loeve

Welford, B. P. (1962). Note on a method for calculating corrected sums of squares and products,

West, D. H. D. (1979). Updating mean and variance estimates: an improved method,

National Laboratories.

*Technometrics* 4: 419–420.

*Communications of the ACM* 22: 532–535.

pp. 293–298.

and arbitrary-order statistical moments, *Technical Report SAND2008-6212*, Sandia

transform and spherical harmonics, *IEEE 2001 Workshop Multimedia Signal Processing*,

*Edited by Parinya Sanguansat*

This book is aimed at raising awareness of researchers, scientists and engineers on the benefits of Principal Component Analysis (PCA) in data analysis. In this book, the reader will find the applications of PCA in fields such as image processing, biometric, face recognition and speech processing. It also includes the core concepts and the stateof-the-art methods in data analysis and feature extraction.

Principal Component Analysis

Principal Component

Analysis

*Edited by Parinya Sanguansat*

Photo by agsandrew / iStock