A Mathematical Primer for Computational Structural Biology

C. Bajaj

October 15, 2014 2 Contents

Introduction 9

1 Graphs, Triangulations and Complexes 11 1.1 Graph Theory ...... 11 1.2 Combinatorial vs. Embedded Graphs ...... 11 1.2.1 Network Theory ...... 12 1.2.2 Trees and Spanning Trees ...... 12 1.3 Topological Complexes ...... 12 1.3.1 Pointset Topology ...... 12 1.3.2 CW-complexes ...... 13 1.4 Primal and Dual Complexes ...... 13 1.4.1 Primal Meshes ...... 13 1.4.2 Dual Complexes ...... 15 1.5 Voronoi and Delaunay Decompositions ...... 16 1.5.1 Euclidean vs. Power distance...... 17 1.5.2 Weighted Alpha Shapes ...... 18 1.6 Biological Applications ...... 19 1.6.1 Union of Balls Topology ...... 19 1.6.2 Meshing of Molecular Interfaces ...... 20 Summary ...... 25 References and Further Reading ...... 25 Exercises ...... 25

2 Sets, Functions and Mappings 27 2.1 Scalar, Vector and Tensor Functions ...... 27 2.2 Piecewise-defined Functions ...... 27 2.3 Height and Morse functions ...... 27 2.4 The Morse-Smale Complex ...... 28 2.5 Signed Distance Function and Critical Points of Discrete Distance Functions ...... 28 2.6 Complementary space topology and geometry ...... 29 2.6.1 Detection of Tunnels and Pockets ...... 30 2.7 Algebraic Functions ...... 33 2.7.1 Polynomial and Rational Parametric ...... 33 2.7.2 Local and Global Parameterization ...... 35 2.8 Piecewise Polynomials, Geometric Continuity, Finite Elements ...... 73 2.8.1 Bernstein-Bezier ...... 73 2.9 A-Splines, B-Splines, Box-Splines ...... 76 2.9.1 B-Spline Basis ...... 76 2.9.2 Implicit Algebraic Surface Patches ...... 77 2.9.3 Parametric basis ...... 78 2.10 Biological Applications ...... 78

3 4 CONTENTS

2.10.1 Tertiary Motif Detection ...... 78 2.10.2 Ion channel models ...... 78 2.10.3 Ribosome models ...... 80 2.10.4 Topological Agreement of Reduced Models ...... 81 2.10.5 Dynamic Deformation Visualization ...... 82 Summary ...... 82 References and Further Reading ...... 82 Exercises ...... 82

3 Differential Geometry, Operators 83 3.1 Shape Operators, First and Second Fundamental Forms ...... 83 3.1.1 : Gaussian, Mean ...... 83 3.1.2 The Shape of Space: convex, planar, hyperbolic ...... 83 3.1.3 Laplacian Eigenfunctions ...... 83 3.2 Finite Element Basis, Functional Spaces, Inner Products ...... 83 3.2.1 Hilbert Complexes ...... 83 3.3 Topology of Function Spaces ...... 83 3.4 Differential Operators and their Discretization formulas ...... 83 3.5 Conformal Mappings from Intrinsic Curvature ...... 84 3.6 Biological Applications ...... 85 3.6.1 Molecular Surface Analysis ...... 85 3.6.2 Solving PDEs in Biology ...... 85 Summary ...... 85 References and Further Reading ...... 85 Exercises ...... 85

4 Differential Forms and Homology of Discrete Functions 87 4.1 Exterior Calculus ...... 87 4.2 deRham Cohomology ...... 88 4.3 k-forms and k-cochains ...... 88 4.3.1 Discrete Differential Forms ...... 88 4.3.2 Discrete Exterior Derivative ...... 89 4.4 Types of k-form Finite Elements ...... 90 4.4.1 Nédélec Elements ...... 90 4.4.2 Whitney Elements ...... 91 4.5 Biological Applications ...... 92 4.5.1 Solving Poisson’s Equation and other PDEs from Biology ...... 92 Summary ...... 92 References and Further Reading ...... 92 Exercises ...... 92

5 Numerical Integration, Linear Systems 93 5.1 Numerical Quadrature ...... 93 5.2 Collocation ...... 93 5.3 Fast Multipole ...... 93 5.4 Biological Applications ...... 93 5.4.1 Efficient Computation of Molecular Energetics ...... 93 5.4.2 PB and GB Energy Calculation ...... 93 Summary ...... 93 References and Further Reading ...... 93 Exercises ...... 93 CONTENTS 5

6 Transforms 95 6.1 Radon Transform ...... 95 6.2 Fourier Transforms ...... 95 6.3 Fast Approximate Summations ...... 95 6.4 Biological Applications ...... 95 6.4.1 Fast Computation of Molecular Energetics ...... 95 Summary ...... 95 References and Further Reading ...... 95 Exercises ...... 95

7 Groups, Tilings, and Packings 97 7.1 Crystal Symmetries ...... 97 7.1.1 Symmetries ...... 97 7.1.2 Quasi-symmetries ...... 97 7.2 Hexagonal Tilings ...... 97 7.2.1 Caspar-Klug coordinate system ...... 97 7.2.2 T-numbers ...... 97 7.2.3 P-numbers ...... 97 7.3 Icosahedral Packings ...... 97 7.4 Biological Applications ...... 97 7.4.1 Crystal Structures ...... 97 7.4.2 Viral Capsid Symmetry Detection and Classification ...... 97 7.4.3 Characterization of Large Deformations in Molecules ...... 97 Summary ...... 97 References and Further Reading ...... 97 Exercises ...... 97

8 Motion Groups, Sampling 99 8.1 Rotation Group ...... 99 8.2 Fourier Transforms ...... 99 8.3 Sampling ...... 99 8.3.1 Uniform ...... 99 8.3.2 Non-uniform ...... 99 8.4 Biological Applications ...... 99 8.4.1 Docking Problem ...... 99 8.4.2 Flexible Fitting ...... 99 Summary ...... 99 References and Further Reading ...... 99 Exercises ...... 99

9 Optimization 101 9.1 Combinatorial ...... 101 9.2 Geometric ...... 101 9.2.1 Linear Programs ...... 101 9.2.2 Quadratic Programs ...... 101 9.2.3 Convex ...... 101 9.2.4 Non-Convex ...... 101 9.3 Biological Applications ...... 101 9.3.1 Fast Computation Methods ...... 101 Summary ...... 101 References and Further Reading ...... 101 Exercises ...... 101 6 CONTENTS

10 Statistics 103 10.1 Classical ...... 103 10.2 Bayesian ...... 103 10.3 Biological Applications ...... 103 Summary ...... 103 References and Further Reading ...... 103 Exercises ...... 103

Biology Appendix 105

Conclusion 107 Preface

A mix of algebra and geometry, combinatorics, and topology, A mathematical primer for those working in algorithmic and computational structural biology, i.e.modeling and discovering biological structure to function relationships using the computer Lacks statistics Thanks to members of ccv

7 8 CONTENTS Introduction

intro to math (algebra, geometry, topology) for structural biology Index to content of chapters: chap 2 describes triangulations, convex decompositions, tilings, packings, chap 3 describes polynomials, piecewise polynomials, algebraic functions, splines over triangulations chap 4 describes differential geometry, inner products and discretization of differential operators used in finite difference and finite element solution of PDE’s chap 5 describes morse-smale complexes, critical point, integral manifold stratifications of shape and smooth and discrete functions chap 6 describes exterior calculus, differential forms and homology of discrete function spaces used in solution of PDE’s chap 7 describes branching topology and geometry as in neuronal and vascular structure

9 10 CONTENTS Chapter 1

Graphs, Triangulations and Complexes

Key Chapter Concepts

Intertwined role of geometry, topology and combinatorics in domain definition. • Unification of concepts for describing shape in any dimmension. • Smooth shape description needed at all scales of biological modeling. •

1.1 Graph Theory

1.2 Combinatorial vs. Embedded Graphs

A graph is a set of V of vertices and a set E of edges between vertices. An embedded graph is a graph where V Rn.A planar graph is a graph where V R2 such that no vertices are duplicates and no edges intersect. If a graph is not⊂ embedded, it is called a combinatorial graph⊂. Embedded Graphs

The two graphs shown are the same if interpreted as combinatorial graphs but different if interpreted as embedded graphs. This reflects the basic notion that topological properties (e.g. the adjacency relations between vertices) are more fundamental to a shape than geometrical properties (e.g. the particular location in space of each vertex). In biological modeling, topological properties are often well known while geometrical properties are more difficult to characterize. For instance, the sequence of amino acids along a particular protein stays fixed even while the actual shape of the protein undergoes rapid, frequent, and sometimes dramatic geometric changes. The genus of a graph is defined to be the smallest value g such that the graph can be embedded on a surface of genus g. The Euler characteristic of a graph is given by

χ := V E + F − where V,E,F are the number of vertices, edges and faces in the mesh, respectively. It is a theorem of algebraic topology that χ is an invariant of a domain, i.e. its value is independent of the mesh used to compute it so long as that mesh is homeomorphic to the domain.

11 12 CHAPTER 1. GRAPHS, TRIANGULATIONS AND COMPLEXES

The Euler characteristic is related to the genus of the domain by the relationship

χ = 2 2g −

1.2.1 Network Theory

A direceted graph is a graph whose edges have a specific orientation. A flow network is a directed graph where each edge also has a capacity. Max Cut Min Flow Theorem A flow network can be thought of as a highway system with only one-way streets. Vertices represent locations and edges represent the streets between them. The direction of an edge indicates which way traffic is allowed to travel on that street. The capacity of an edge represents the maximum traffic that can flow down the street at any one moment (e.g. the number of lanes in the road). The Max Cut Min Flow Theorem states that in a flow network, the maximum amount of flow passing from a source to a sink is equal to the minimum capacity which when removed in a specific way from the network causes the situation that no flow can pass from the source to the sink. It is a formalization and generalization of the familiar notion that a chain is only as strong as its weakest link.

1.2.2 Trees and Spanning Trees

Minimal spanning trees, etc.

1.3 Topological Complexes

1.3.1 Pointset Topology

Let S be a set and let T be a family of subsets of S. Then T is called a topology on S if

Both the empty set and S are elements of T . •

Any union of arbitrarily many elements of T is an element of T . •

Any intersection of finitely many elements of T is an element of T . •

If T is a topology on S, then the pair (S, T ) is called a topological space. If the topology is implicit, the space S is listed without mention of T . The members of T are called the open sets of S. A set is called closed if its complement is in T . A neighborhood of a point x S is any element of T containing x. ∈ We will often deal with subsets of Rn with the usual topology. This means the set S is the points of Rn and the T is formed from all open balls of any radius in Rn. 1.4. PRIMAL AND DUAL COMPLEXES 13

Manifolds

torus half sphere

A manifold is a special kind of topological space commonly used in domain modeling. At any point x in an n- manifold M, there exists a neighborhood of x which is homeomorphic to Rn. Thus the surface of a sphere, the surface of a cube and the surface of a torus are all examples both 2-manifolds. If the manifold has boundary, then its boundary is described by those points which only have neighborhoods homeomorphic to Rn−1. In the figure, the sphere and torus have genus 1 and 2, respectively. The half sphere is an example of a 2-manifold with boundary.

1.3.2 CW-complexes A Hausdorff space is a topological space in which distinct points have disjoint neighborhoods.

Definition 1.1. A CW-complex is a Hausdorff space X together with a partition of X into open cells of varying dimension such that

1. For each n-dimensional open cell C in the set X, there exists a continuous map f from the n-dimensional closed ball to X such that the restriction of f onto the interior of the ball is a homeomorphism onto the cell C.

2. The image of the boundary of the open ball (i.e. the boundary of the open cell C) intersects only finitely many other cells.

A CW-complex can be presented as a sequence of spaces and maps

X0 , X1 , ..., Xn , ... → → → → where each space Xn, called the n-dimensional skeleton of the presentation, is the result of attaching copies of the n-disk n n n−1 n D := x R : x 1 along their boundaries S := ∂D to Xn−1. { ∈ || || ≤ } A Voronoi decomposition is a special kind of the more general class of CW-complexes. Computational Homology Triangulationas and CW-complexes can be used to compute the homology groups of a manifold, a topological invariant. The ranks of these groups are called the Betti numbers, a simple and geometrically meaninful topological invariant. We will discuss this further in Section 2.6.1.

1.4 Primal and Dual Complexes

1.4.1 Primal Meshes In algebraic topology, manifolds are discretized using simplicial complexes, a notion which guides the entire theory of discrete exterior calculus. We state the definition of simplicial complex here, along with supporting definitions to be used throughout. 14 CHAPTER 1. GRAPHS, TRIANGULATIONS AND COMPLEXES

k N Definition 1.2. A k-simplex σ is the convex hull of k + 1 geometrically independent points v0, . . . , vk R . Any simplex k ∈ k spanned by a (proper) subset of v0, . . . , vk is called a (proper) face of σ . The union of the proper faces of σ is called its boundary and denoted Bd(σk{). The interior} of σk is Int(σk) = σk Bd(σk). Note that Int(σ0)=σ0. The volume of σk is denoted σk . Define σ0 = 1. \ | | | | ♦ Primal Simplicies

Primal simplices of dimension 0, 1, 2, and 3 are shown. In general, a k-simplex is the convex hull of k points in Rn in general position. We denote a k-simplex as σk. We will indicate that a simplex has dimension k with a superscript, e.g. σk, and will index simplices of any dimension with subscripts, e.g. σi.

Definition 1.3. A simplicial complex K in RN is a collection of simplices in RN such that 1. Every face of a simplex of K is in K. 2. The intersection of any two simplices of K is either a face of each of them or it is empty.

The union of all simplices of K treated as a subset of RN is called the underlying space of K and is denoted by K . | | ♦ Definition 1.4. A simplicial complex of dimension n is called a manifold-like simplicial complex if and only if K is a C0-manifold, with or without boundary. More precisely, | | 1. All simplices of dimension k with 0 k n 1 must be a face of some simplex of dimension n in K. ≤ ≤ − 2. Each point on K has a neighborhood homeomorphic to Rn or n-dimensional half-space. | | ♦ Remark 1.5. Since DEC is meant to treat discretizations of manifolds, we will assume all simplicial complexes are manifold- like from here forward. We note that K is thought of as a piecewise linear approximation of a smooth manifold Ω. Formally, this is taken to mean that there exists| a| homeomorphism h between K and Ω such that h is isotopic to the identity. In applications, however, knowing h or Ω explicitly may be irrelevant or impossible| | as K often encodes everything known about Ω. This emphasizes the usefulness of DEC as a theory built for discrete settings. ♦

Orientation of Simplicial Complexes We now review how to orient a simplicial complex K. Definition 1.6. Define two orderings of the vertices of a simplex σk (k 1) to be equivalent if they differ by an even permutation. Thus, there are two equivalence classes of orderings, each of which≥ is called an orientation of σk. If σk is written k as [v0, . . . , vk], the orientation of σ is understood to be the equivalence class of this ordering. ♦ k Definition 1.7. Let σ = [v0, . . . , vk] be an oriented simplex with k 2. This gives an induced orientation on each of the k k ≥ (k 1)-dimensional faces of σ as follows. Each face of σ can be written uniquely as [v0,..., vˆi, . . . , vk], where vˆi means vi − is omitted. If i is even, the induced orientation on the face is the same as the oriented simplex [v0,..., vˆi, . . . , vk]. If i is odd, it is the opposite. ♦ We note that this formal definition of induced orientation agrees with the notion of orientation induced by the boundary operator (Definition 4.12). In that setting, a 0-simplex can also receive an induced orientation. Remark 1.8. We will need to be able to compare the orientation of two oriented k-simplices σk and τ k. This is possible only if at least one of the following conditions holds:

1. There exists a k-dimensional affine subspace P RN containing both σk and τ k. ⊂ 2. σk and τ k share a face of dimension k 1. − 1.4. PRIMAL AND DUAL COMPLEXES 15

k k In the first case, write σ = [v0, . . . , vk] and τ = [w0, . . . , wk]. Note that v1 v0, v2 v0, . . . , vk v0 and w1 w0, w2 k k { − − − } { − − w0, . . . , wk w0 are two ordered bases of P . We say σ and τ have the same orientation if these bases orient P the same way. Otherwise,− we} say they have opposite orientations. In the second case, σk and τ k are said to have the same orientation if the induced orientation on the shared k 1 face induced by σk is opposite to that induced by τ k. − ♦ Definition 1.9. Let σk and τ k with 1 k n be two simplices whose orientations can be compared, as explained in Remark 1.8. If they have the same orientation,≤ we say≤ the simplices have a relative orientation of +1, otherwise 1. This is denoted as sgn(σk, τ k) = +1 or 1, respectively. − − ♦ Definition 1.10. A manifold-like simplicial complex K of dimension n is called an oriented manifold-like simplicial complex if adjacent n-simplices agree on the orientation of their shared face. Such a complex will be called a primal mesh from here forward. ♦

1.4.2 Dual Complexes

Dual complexes are defined relative to a primal mesh. While they represent the same subset of RN as their associated pri- mal mesh, they create a different data structure for the geometrical information and become essential in defining the various operators needed for DEC. Dual Cells

Dual cells of dimension 0, 1, 2, and 3 are shown. In general, a k-cell is the convex hull of k points in Rn homeomorphic to a filled k-ball such that the boundary of the k-cell is a collection of k 1 cells. If a k-cell is defined as the dual of an n k simplex, we denote it as ?σn−k. − − Definition 1.11. The circumcenter of a k-simplex σk is given by the center of the unique k-sphere that has all k +1 vertices of σk on its surface. It is denoted c(σk). A simplex σk is said to be well-centered if c(σk) Int(σk). A well-centered simplicial ∈ complex is one in which all simplices (of all dimensions) in the complex are well-centered. ♦ Definition 1.12. Let K be a well-centered primal mesh of dimension n and let σk be a simplex in K. The circumcentric dual cell of σk, denoted D(σk), is given by

n−k k [ [ k D(σ ) := Int(c(σ )c(σ1) . . . c(σr)). k r=0 σ ≺σ1≺···≺σr

To clarify, the inner union is taken over all sequences of r simplices such that σk is the first element in the sequence and each sequence element is a proper face of its successor. Hence, σ1 is a (k + 1) simplex and σr is an n simplex. For r = 0, this is to be interpreted as the sequence σk only. The closure of the dual cell of σk is denoted D¯(σk) and called the closed dual cell. We will use the notation ? to indicate dual cells, i.e. ?σ := D¯(σ).

k k Each (n k)-simplex on the points c(σ ), c(σ1), . . . , c(σr) is called an elementary dual simplex of σ . The collection of dual − cells is called the dual cell decomposition of K and denoted D(K) or ?K. ♦ Note that the dual cell decomposition forms a CW complex. 16 CHAPTER 1. GRAPHS, TRIANGULATIONS AND COMPLEXES

Orientation of Dual Complexes Orientation of the dual complex must be done in a such a way that it “agrees” with the orientation of the primal mesh. This can be done canonically since a primal simplex and any of its elementary dual simplices have complementary dimension and live in orthogonal affine subspaces of RN . We make this more precise and fix the necessary conventions with the following definitions. Definition 1.13. Let K be a primal mesh containing a sequence of simplices σ0 σ1 σn and let σk be one of these simplices with 1 k n 1. The orientation of the elementary dual simplex≺ ≺ with · · · vertices ≺ c(σk), . . . , c(σn) is s[c(σk), . . . , c(σn)] where≤ s ≤ 1−, +1 is given by the formula ∈ {− } s := sgn [c(σ0), . . . , c(σk)], σk sgn [c(σ0), . . . , c(σn)], σn . × The sgn function was defined in Definition 1.9. 0 n n For k = n, the dual element is a vertex which has no orientation. For k = 0, define s := sgn [c(σ ), . . . , c(σ )], σ . ♦ The above definition serves to orient all the elementary dual simplices associated to σk and hence all simplices in a dual cell decomposition. Further, the orientations on the elementary dual simplices induce orientations on the boundaries of dual cells in the same manner as given in Definition 1.7. The induced orientations on adjacent (n 1) cells will agree since the dual cell decomposition comes from a primal mesh (see Definition 1.10). − Definition 1.14. The oriented dual cell decomposition of a primal mesh is called the dual mesh. ♦

1.5 Voronoi and Delaunay Decompositions

For a finite set of points P in R3, the Voronoi cell of p P is ∈ 3 Vp = x R : q P p , x p x q ) . { ∈ ∀ ∈ − { } k − k ≤ k − k } If the points are in general position, two Voronoi cells with non-empty intersection meet along a planar, convex Voronoi facet, three Voronoi cells with non-empty intersection meet along a common Voronoi edge and four Voronoi cells with non-empty intersection meet at a Voronoi vertex. A cell decomposition consisting of the Voronoi objects, that is, Voronoi cells, facets, edges and vertices is the Voronoi diagram Vor P of the point set P . Voronoi and Delaunay Meshes

Voronoi and Delaunay meshes are dual decompositions of the same domain. In the figure, the small red dots define the Voronoi cells and hence a dual mesh of the domain (shown at right) but also define the vertices of the Delaunay triangles and hence a primal mesh of the domain (shown at left). 1.5. VORONOI AND DELAUNAY DECOMPOSITIONS 17

The dual of Vor P is the Delaunay diagram Del P of P which is a simplicial complex when the points are in general position. The tetrahedra are dual to the Voronoi vertices, the triangles are dual to the Voronoi edges, the edges are dual to the Voronoi facets and the vertices (sample points from P ) are dual to the Voronoi cells. We also refer to the Delaunay simplices as Delaunay objects.

1.5.1 Euclidean vs. Power distance. For MVC the choice of using the Power distance in place of the Euclidean distance is motivated by the the efficiency and simplicity of the construction of the power diagram together with the fact that the power distance can be proven to be an upper bound of the Euclidean distance.

(a) (b)

Figure 1.1: Relationship between the Euclidean distance E(p, B) between the point p and the ball B and their Power distance P (p, B), (a) Configuration for d > r. (b) Configuration for d < r.

Consider a point p at distance d from the center c a ball B of radius r as in Figure 1.1. We define:

E(p, B) = d r ,P (p, B) = p d2 r2 . | − | | − | Then we have the following chain of inequalities (where r and d are positive numbers): 0 4dr(d r)2 = 4d3r 8d2r2 + 4dr3 ≤ − − (d r)4 = d4 4d3r + 6d2r2 4dr3 + r4 − − − d4 2d2r2 + r4 = (d2 r2)2 ≤ − − E(p, B) = d r p d2 r2 = P (p, B) . | − | ≤ | − | If the point p is outside the ball B the following inequality holds (both r and d are positive numbers): r < d r d 0 − ≤ 2r2 2rd 0 − ≤ 2r2 2rd + d2 d2 − ≤ r2 2rd + d2 d2 r2 − ≤ − (r d)2 d2 r2 − ≤ p − (r d) d2 r2 − ≤ − E(p, B) P (p, B) ≤ 18 CHAPTER 1. GRAPHS, TRIANGULATIONS AND COMPLEXES

That is the P (p, B) is larger than the Euclidean distance E(p, B) . The same relation holds if p is inside B:

d r ≤ d r 0 − ≤ 2d2 2rd 0 − ≤ 2d2 2rd + r2 r2 − ≤ d2 2rd + r2 r2 d2 − ≤ − (d r)2 r2 d2 − ≤ p − (d r) r2 d2 − ≤ − E(p, B) P (p, B) ≤ In conclusion we have that for any given ball B and point p, the function P (p, B) provides an upper bound on the distance E(p, b): E(p, B) P (p, B) , (1.1) ≤ with equality holding only when d = r, i. e. the point is on the surface of the ball (and in trivial cases where d or r is zero). For a collection of n balls = B1,...,Bn the distance functions are extended as follows: B { }

E(p, ) = min di ri (1.2) B 1≤i≤n | − |

r 2 2 P (p, ) = min di ri (1.3) B 1≤i≤n | − |

The problem in comparing E(p, ) with P (p, ) is that they may achieve their minimum for different values of i because in general the Power diagram is not coincidentB with theB Voronoi diagram. Figure 1.5.1 shows an example of comparison between the Voronoi diagram of two (in red) with the corresponding Power diagram (in blue). In this example the minimum distance of the point p from the set = B1,B2 is achieved at i = 1 for P (p, ) and at i = 2 for E(p, ): B { } B B

P (p, ) = P (p, B1) B

E(p, ) = E(p, B2) . B

In general for a given point p we call iP , iE the two indices such that:

P (p, ) = P (p, Bi ) B P

E(p, ) = E(p, Bi ) . B E From equations (1.2) and (1.1) we have that:

E(p, ) = E(p, Bi ) E(p, Bi ) B E ≤ P P (p, Bi ) = P (p, ) . ≤ P B

1.5.2 Weighted Alpha Shapes

A simplex s in the regular triangulation of Pi belongs to the α-shape of Pi only if the orthogonal center of (the weighted point orthogonal to the vertices of) s is smaller{ } than α. The alpha shape where{ }α = 0, called the zero-shape, is the topological 2 structure of molecules. For example, an edge e = (u, v) is a part of the zero-shape only if u v wu wv < 0, which means that the two balls centered at u and v intersect (Figure 1.3(d)). k − k − − 1.6. BIOLOGICAL APPLICATIONS 19

(a) (b)

Figure 1.2: Power diagram (in blue) and Voronoi diagram (in red) of two circles. (a) Case of nonintersecting circles. (b) Case of intersecting circles.

1.6 Biological Applications

1.6.1 Union of Balls Topology

Stereographic Projection

∞ ∞ a c a b c

b

For any integer n 1, the space Rn can be mapped to the n-dimensional sphere, commonly denoted Sn by a mapping called≥ stereographic projection∪ {∞} . In the 1D case shown above, the real is mapped to the S1 by wrapping the points at infinity together to the top of the circle. The general form of the mapping is given by

n n 1 s : S R , (x1, . . . , xn+1) (x1, . . . , xn) → → 1 xn+1 − with the convention (0,..., 1) . This process can be used to wrap 2D power diagrams into 3D polytopes. → {∞}

Power Diagram

n n Given a weighted point P = (p, wp) where p IR and w IR, the power distance from a point x IR to P is defined as ∈ ∈ ∈ q 2 πP (x) = p x wp , k − k − where p x is the ordinary Euclidean distance between p and x. k − k 2 In molecule context, we define the weight of an atom B with center at p and radius r to be wB = r . The power distance of x to B is p 2 2 πB(x) = p x r . k − k − 20 CHAPTER 1. GRAPHS, TRIANGULATIONS AND COMPLEXES

(a) (b) (c) (d) (e) (f)

Figure 1.3: The combinatorial and geometric structures underlying a molecular shape: (a) The collection of balls (weighted points). (b) Power diagram of a set of the points. (c) Regular triangulation. (d) The α-shape (with α = 0) of the points. (e) Partitioning of the molecular body induced by the power diagram. (f) The boundary of the molecular body.

Given a set Pi of weighted vertices (each vertex has a weight wi associated with it), the Power Diagram is a tiling of the { } space into convex regions where the ith tile is the set of points nearest to the vertex Pi, in the power distance metric The power diagram is similar to the Voronoi diagram using the power distance instead of Euclidean distance. The weighted Voronoi cell of a ball B in a molecule is the set of points in space whose weighted distance to B is less than or equal to their weighted distance to any other ball inB : B 2 VB = x IR πB(x) πC (x) C . { ∈ | ≤ ∀ ∈ B} The power diagram of a molecule is the union of the weighted Voronoi cells for each of its atoms (Figure 1.3(b)).

Regular Triangulation The regular triangulation, or weighted Delaunay triangulation, is the dual (face adjacency graph) of the power diagram, just as the Delaunay triangulation is the dual shape of the Voronoi diagram. Vertices in the triangulation are connected if and only if their corresponding weighted Voronoi cells have a common face (Figure 1.3(c)). This implies that two vertices are connected if and only if they have a nearest neighbor relation measured in power distance metric Given a set of n 2D points with weights, it has been shown , that their regular triangulation can be computed in O(n log n) time, by incrementally inserting new points to the existing triangulation and correcting it using edge flips.

Wrapping the Power Diagram We can model a union of balls as an embedded graph. If two balls intersect, their circle of intersection can be defined by three points. The arcs connecting these points are directed edges and can be parametrized as portions of a circle. Each face is portion of a sphere and the circular arcs defining its boundary. This can be captured compactly as a graph structure (vertices, edges, and faces). Moreover, the weighted Delaunay triangulation of the centers of the balls defines the topology of the volume. An edge in the complex corresponds to two balls intersecting and a face (triangle) corresponds to three balls intersecting. A cycle of three edges without a face corresponds to three balls which intersect pairwise but not mutually. We can wrap the weighted Delaunay diagram onto the 4-sphere using sterographic projection (see box). This mapping results in a polytope that compactly represents the union of balls topology and surface patch embedded graph.

1.6.2 Meshing of Molecular Interfaces In this subsection, we describe an approach to generate quality triangular/tetrahedral meshes for complicated biomolecular structures directly from the PDB format data, conforming to a good implicit solvation surface approximation. There are three main steps in our mesh generation process:

1. Implicit Solvation Surface Construction – A smooth implicit solvation model is constructed to approximate the Lee- Richards molecular surface by using weighted Gaussian isotropic atomic kernel functions and a two-level clustering techniques. 1.6. BIOLOGICAL APPLICATIONS 21

2. Mesh Generation – A modified dual contouring method is used to extract triangular and interior/exterior tetrahedral meshes, conforming to the implicit solvation surface. The dual contouring method is selected for mesh generation as it tends to yield meshes with better aspect ratio. In order to generate exterior meshes described by biophysical applications , we add a sphere or box outside the implicit solvation surface, and create an outer boundary. Our extracted tetrahedral mesh is spatially adaptive and attempts to preserve molecular surface features while minimizing the number of elements.

3. Quality Improvement – Geometric flows are used to improve the quality of extracted triangular and tetrahedral meshes.

The generated tetrahedral meshes of the monomeric and tetrameric mouse acetylcholinesterase (mAChE) have been suc- cessfully used in solving the steady-state Smoluchowski equation using the finite element method .

Mesh Generation There are two main methods for contouring scalar fields, primal contouring and dual contouring . Both of them can be extended to tetrahedral mesh generation. The dual contouring method is often the method of choice as it tends to yield meshes with better aspect ratio.

Triangular Meshing Dual contouring uses an octree data structure, and analyzes those edges that have endpoints lying on different sides of the isosurface, called sign change edges. The mesh adaptivity is determined during a top-down octree construction. Each sign change edge is shared by either four (uniform case) or three (adaptive case) cells, and one minimizer point is calculated for each of them by minimizing a predefined Quadratic Error Function (QEF) :

X 2 QEF [x] = [ni (x pi)] , (1.4) · − i where pi, ni represent the position and unit vectors of the intersubsection point respectively. For each sign change edge, a quad or triangle is constructed by connecting the minimizers. These quads and triangles provide a ‘dual’ approximation of the isosurface. A recursive cell subdivision process was used to preserve the trilinear topology of the isosurface. During cell subdivision, the function value at each newly inserted grid point can be exactly calculated since we know the volumetric function. Addition- ally, we can generate a more accurate triangular mesh by projecting each generated minimizer point onto the isosurface.

Tetrahedral Meshing The dual contouring method has already been extended to extract tetrahedral meshes from volumetric scalar fields . The cells containing the isosurface are called boundary cells, and the interior cells are those cells whose eight vertices are inside the isosurface. In the tetrahedral mesh extraction process, all the boundary cells and the interior cells need to be analyzed in the octree data structure. There are two kinds of edges in boundary cells, one is a sign change edge, the other is an interior edge. Interior cells only have interior edges. In [192, 193], interior edges and interior faces in boundary cells are dealt with in a special way, and the volume inside boundary cells is tetrahedralized. For interior cells, we only need to split them into tetrahedra. Adding an Outer Boundary In biological diffusion systems, we need to analyze the electrostatic potential field which is faraway from the molecular surface . Assume that the radius of the circum-sphere of a biomolecule is r. The computational model can be approximated by a field from an outer sphere S1 with the radius of (20 40)r to the molecular surface. Therefore the exterior mesh is defined as the tetrahedralization of the interval volume between∼ the molecular surface and the outer sphere S1 (Fig. 1.4(b)). n n−1 First we add a sphere S0 with the radius of r0 (where r0 > r and r0 = 2 /2 = 2 ) outside the molecular surface, and generate meshes between the molecular surface and the outer sphere S0. Then we extend the tetrahedral meshes from the sphere S0 to the outer bounding sphere S1. For each data point inside the molecular surface, we keep the original function value. While for each data point outside the molecular surface, we reset the function value as the smaller one of f(x) α and − the shortest distance from the grid point to the sphere S0. Eqn. (1.5) shows the newly constructed function g(x) which provides a grid-based volumetric data containing the biomolecular surface and an outer sphere S0.   min(kx − x0k − r0, f(x) − α), iff(x) < α, kx − x0k < r0, g(x) = kx − x0k − r0, iff(x) < α, kx − x0k ≥ r0, (1.5)  f(x) − α, iff(x) ≥ α, 22 CHAPTER 1. GRAPHS, TRIANGULATIONS AND COMPLEXES

(a) (b) (c)

Figure 1.4: The analysis domain of exterior meshes. (a) - ‘O’ is the geometric center of the molecule, suppose the circum- sphere of the biomolecule has the radius of r. The box represents the volumetric data, and ‘S0’ is the maximum sphere inside the box, the radius is r0(r0 > r).‘S1’ is an outer sphere with the radius of r1(r1 = (20 40)r). (b) - the diffusion domain ∼ is the interval volume between the molecular surface and the outer sphere ‘S1’, here we choose r1 = 5r for visualization. (c) - the outer boundary is a cubic box.

where x0 are coordinates of the molecular geometric center. The isovalue α = 0.5 for volumetric data generated from the characteristic function, and α = 1.0 for volumetric data generated from the summation of Gaussian kernels. The molecular surface and the outer sphere S0 can be extracted as an isosurface at the isovalue 0, Sg(0) = x g(x) = 0 . { | } All the grid points inside the interval volume Ig(0) = x g(x) 0 have negative function values, and all the grid points outside it have positive values. { | ≤ }

(a) (b)

Figure 1.5: 2D triangulation. (a) Old scheme, (b) New scheme. Blue and yellow triangles are generated for sign change edges and interior edges respectively. The red represents the molecular surface, and the green points represent minimizer points.

Mesh Extraction Here we introduce a different scheme from the algorithm presented in [192, 193], in which we do not distinguish boundary cells and interior cells when we analyze edges. We only consider two kinds of edges - sign change edges and interior edges. For each boundary cell, we can obtain a minimizer point by minimizing its Quadratic Error Function. For each interior cell, we set the middle point of the cell as its minimizer point. Fig. 1.5(b) shows a simple 2D example. In 2D, there are two cells sharing each edge, and two minimizer points are obtained. For each sign change edge, the two minimizers and the interior 1.6. BIOLOGICAL APPLICATIONS 23 vertex of this edge construct a triangle (blue triangles). For each interior edge, each minimizer point and this edge construct a triangle (yellow triangles). In 3D as shown in Fig. 1.6, there are three or four cells sharing each edge. Therefore, the three (or four) minimizers and the interior vertex of the sign change edge construct one (or two) tetrahedron, while the three (or four) minimizers and the interior edge construct two (or four) tetrahedra.

Figure 1.6: Sign change edges and interior edges are analyzed in 3D tetrahedralization. (a)(b) - sign change edge (the red edge); (c)(d) - interior edge (the red edge). The green solid points represent minimizer points, and the red solid points represent the interior vertex of the sign change edge.

Compared with the algorithm presented in [192, 193] as shown in Fig. 1.5(a), Fig. 1.5(b) generates the same surface meshes, and tends to generate more regular interior meshes with better aspect ratio, but a few more elements for interior cells. Fig. 1.5(b) can be easily extended to large volume decomposition. For arbitrary large volume data, it is difficult to import all the data into memory at the same time. So we first divide the large volume data into some small subvolumes, then mesh each subvolume separately. For those sign change edges and interior edges lying on the interfaces between subvolumes, we analyze them separately. Finally, the generated meshes are merged together to obtain the desired mesh. The mesh adaptivity is controlled by the structural properties of biomolecules. The extracted tetrahedral mesh is finer around the molecular surface, and gradually gets coarser from the molecular surface out towards the outer sphere, S0. Furthermore, we generate the finest mesh around the active site, such as the cavity in the monomeric and tetrameric mAChE shown in Fig.?? (a b), and a coarse mesh everywhere else. ∼ Mesh Extension

Figure 1.7: (a) - one triangle in the sphere S0 (blue) is extended n steps until arriving at the sphere S1 (red); (b) and (c) - a prism is decomposed into three tetrahedra in two different ways.

We have generated meshes between the biomolecular surface and the outer sphere S0, the next step is to construct tetrahedral meshes gradually from the sphere S0 to the bounding sphere S1 (Fig. 1.4). The sphere S0 consists of triangles, so we extend each triangle radially as shown in Fig. 1.7 and a prism is obtained for each extending step. The prism can be divided into three tetrahedra. The extension step length h can be calculated by Eqn. (1.6). It is better for the sphere S0 to be triangulated uniformly since the step length is fixed for each extension step.

2(r1 r0) r0 + h + 2h + + nh = r1 = h = − (1.6) ··· ⇒ n(n + 1) where n is the step number. In Figure 1.7, suppose u0u1u2 is a triangle on sphere S0, and u0, u1, u2 are the unique index numbers of the three vertices, where u1 < u0 and u1 < u2. For one extension step, u0u1u2 is extended to v0v1v2, and the two 24 CHAPTER 1. GRAPHS, TRIANGULATIONS AND COMPLEXES triangles construct a prism, which can be decomposed into three tetrahedra. In order to avoid the diagonal conflict problem, a different decomposition method (Fig. 1.7(b c)) is chosen based on the index number of the three vertices. If u0 < u2, then we ∼ choose Fig. 1.7(b) to split the prism into three tetrahedra. If u2 < u0, then Fig. 1.7(c) is selected Assume there are m triangles on the sphere S0, which is extended n steps to arrive at the sphere S1. m prisms or 3m tetra- hedra are generated in each extending step, and a total of 3mn tetrahedra are constructed in the extension process. Therefore, it is better to keep a coarse and uniform triangular mesh on the sphere S0.

Union of Balls using Voronoi-Cell Complexes Several different approaches have been developed to achieve this efficiency for molecular surface computations [58, 156, 157, 158, 174, 175]. Other work on surface representations features the use of metaballs, molecular surfaces, and blobby models [9, 38, 182, 62, 77, 95, 113, 129, 139, 140, 185, 186, 187]. In previous work on dynamic triangulations the focus has been mostly on the simpler Delaunay/Voronoi structures (un- weighted case) [21, 115, 54, 76, 97, 10, 148, 149]. Little has been done on the more general case of dynamic Regular Triangu- lation/Power Diagrams and for dimensions greater than two. Moreover, the kinds of dynamic operations developed are usually just the insertion/deletion of a single point. Such local operations become inefficient when we need to perform even a simple but global modification.

Molecular Surface Computation using Adaptive Grids Since Richards introduced the SES definition, a number of techniques have been devised to compute the surface, both static and dynamic, implicit and explicit. Connolly introduced two algorithms to compute the surface. First, a dot based numerical surface construction and second, an enumeration of the patches that make up the analytical surface (See [58], [57] and his PhD thesis). In [175], the authors describe a distance function grid for computing surfaces of varying probe radii. Our data structure contains approaches similar to their idea. A number of algorithms were presented using the intersection information given by voronoi diagrams and the alpha shapes introduced by Edelsbrunner [70], including parallel algorithms in [174] and a triangulation scheme in [9]. Fast computations of SES is described in [157] and [156], using Reduced sets, which contains points where the probe is in contact with three atoms, and faces and edges connecting such points. Non Uniform Rational BSplines ( NURBs ) descriptions for the patches of the molecular surfaces are given in [31], [30] and [32]. You and Bashford in [188] defined a grid based algorithm to compute a set of volume elements which make up the Solvent Accessible Region.

Maintaining Union of Balls Under Atom Movements Though a number of techniques have been devised for the static construction of molecular surfaces (e.g., [58, 57, 175, 70, 174, 9, 157, 156, 188, 94, 31, 30, 194, 35]), not much work has been done on neighborhood data structures for the dynamic maintenance of molecular surfaces as needed in MD. In [32] Bajaj et al. considered limited dynamic maintenance of molecular surfaces based on Non Uniform Rational BSplines ( NURBS ) descriptions for the patches. Eyal and Halperin [72, 73] presented an algorithm based on dynamic graph connectivity that updates the union of balls molecular surface after a conformational change in log2 n amortized time per affected (by this change) atom. O Clustering and Decimation of Molecular Surfaces Using multiresolution models for molecules can substantially improve rendering speed and interactive response rates in molec- ular interaction tools. Similar improvements in performance would be achieved when a set of balls is used as an approximate representation of a generic object either for modeling (meta-balls [95, 140], blobby models [187]) or for collision detection [113]. Direct application of previous approaches for the decimation and multiresolution representation of the surfaces them- selves [157, 120] can have serious embedding and self-intersection problems and are specific to the surface definition. A possible solution if this problem has been addressed in [171] but limited to the case of the boundary surface of tetrahedral meshes. Our multiresolution scheme updates the underlying structure of the molecule, maintaining at any level of detail a regular triangulation of the current weighted point-set. In this way we explicitly track the topology of the molecular body at any adaptive level of resolution. Moreover this guarantees correct embedding in all resolutions and creates an approximation from which the surface boundary can be computed in any of the previous schemes. There are many approaches for creating multiresolution representations of geometric data for graphics and visualiza- tion [151, 128, 118]. They vary in both the simplification scheme like vertex removal [60], edge contraction [111], triangle 1.6. BIOLOGICAL APPLICATIONS 25 contraction [84], vertex clustering [161], wavelet analysis [64], and also in the structure used to organize the levels of detail (either a linear order or a using a DAG). Maintaining the regular triangulation at all resolutions rules out the possibility of using decimation techniques like edge or triangle contraction, which do not guarantee the (weighted) Delaunay property. Other known decimation schemes that can guarantee this property such as vertex removal, do not seem appropriate in this case since they do not preserve the molecule features as a subset of the whole triangulation. Techniques which preserve features in the triangulation by tagging specific edges or vertices [53] are more suitable for preserving specific edges or regions. We are more interested in applying the decimation on a subset of the triangulation while this subset can change during the decimation. Sphere trees have also been used in [112] for the purpose of fast collision detection. In this work, Sphere hierarchies are built around a given object either by replacing special octree regions or by placing balls on the medial-axis surfaces approximated using voronoi edges of some point sampling of the object. The basic approach of building the hierarchy by clustering pairs of balls for collision detection [113] is similar to ours. However in this scheme the simplification process does not update the underlying triangulation and hence does not track the topological changes induced by the decimation process. This make also the scheme unable to cluster balls that get in contact only after some simplification steps.

Summary References and Further Reading

Set theory background can be found in Rosen [150]. • Useful references for graph theory include Behzad and Chartrand [37], Chartrand and Lesniak [51], and Giblin [83] • Minimal spanning trees are discussed in Graham and Hell [93] and algorithms for finding them in Kruskal[119] • Useful algebraic topology texts include Armstrong [11] and Hatcher [104]. This includes more formal definitions of • terms like homeomorphism, isomorphism, manifold, and homology.

Some notation on primal and dual meshes has been adapted from Hirani [105]. • For practical computational topology, see Zomorodian [195] • For more on CW complexes, see Munkres [135]. • The power distance metric is described in [13]. • More on regular triangulations in [67, 71] and on weighted alpha shapes in [65, 74]. • Some application references: [192, 193, 43, 44, 169, 170, 191, 116, 80, 109, 122]. • Exercises 26 CHAPTER 1. GRAPHS, TRIANGULATIONS AND COMPLEXES Chapter 2

Sets, Functions and Mappings

2.1 Scalar, Vector and Tensor Functions

Definition 2.1. We use the following basic definitions

A scalar function is a function whose values are in R, i.e. f : V R. • → A vector function is a function whose values are in Rk for some k > 1. i.e. f : V R R. • → | × ·{z · · × } k copies Definition 2.2. Let V be a vector space and let V p denote the Cartesian product of p copies of V . A (real) p-tensor on V is a function T : V p R that it is linear in each variable. −→ The tensor product of a p-tensor T and a q-tensor S is defined by

T S(v1, . . . , vp, vp+1, . . . , vp+q) := T (v1, . . . , vp) S(vp+1, . . . , vp+q) ⊗ · Note that this operation is not symmetric. A tensor T is called alternating or anti-symmetric if and only if the sign of T is reversed whenever two variables are transposed. Let Sp denote the symmetric group on p elements. An arbitrary tensor T is associated to the alternating tensor Alt T , defined by 1 X Alt T := ( 1)πT π, p! − π∈Sp where π T (v1, . . . , vp) := T (vπ(1), . . . , vπ(p)). Alternating p-tensors are closed under scalar multiplication and addition, thereby forming a vector space:

Λp(V ∗) := Alt T : T is a p-tensor on V { } Definition 2.3. If T Λp(V ∗) and S Λq(V ∗), the wedge product of T and S is defined by ∈ ∈ T S := Alt (T S) Λp+q(V ∗) ∧ ⊗ ∈ ♦

2.2 Piecewise-defined Functions 2.3 Height and Morse functions

(From Viz2007 submission):

27 28 CHAPTER 2. SETS, FUNCTIONS AND MAPPINGS

Morse theory provides useful results not only for the construction of contour trees but also for an evaluation of the smooth 1 distance function hΣ defined at the end of Section 1. As in the previous section, we consider a smooth function f : M R , now adding the restriction that M is a compact 3-manifold without boundary. Let m M be a non-degenerate critical point→ of ∈ f, meaning the derivative map dfm is the zero map and the Hessian at m is non-singular. We note that a critical point m lies in the domain M of f as opposed to a critical value r which lies in the range R1 of f. The Morse Lemma [132] states that f exhibits quadratic behavior in a small neighborhood m. That is, we may choose a coordinate chart about m such that locally

f(x, y, z) = f(m) x2 y2 z2 ± ± ± We define the index of m to be the number of minus signs in the equation above. It can be shown that the index is independent of the coordinate chart and that it is equal to the number of negative eigenvalues of the Hessian at m. Thus, in three dimensions, a non-degenerate critical point can have index 0, 1, 2, or 3. These indices correspond to minima, 1-saddles, 2-saddles, and maxima of the function f, respectively

2.4 The Morse-Smale Complex

We can unambiguously connect these critical points into a meaningful structure known as the Morse complex. Away from critical points, the gradient vector f is non-zero and points in the direction of maximum positive change. If we construct a maximal path whose velocity vectors∇ coincide with the gradient vector at each point on the path, we will always connect two critical points. Such a path is called an integral path and necessarily terminates at a critical point of index 1, 2, or 3. We define the stable manifold of a non-degenerate critical point m M to be the union of m and the images of all integral paths on M terminating at m. We note that an unstable manifold can∈ be defined similarly, but we will not need it in this paper. For our purposes, the Morse Complex is defined to be the union of all maxima and their stable manifolds. Previous work employing the Morse complex has dealt primarily with two types of input functions: grids and surfaces. The complex has been defined on two-dimensional grids and three-dimensional unstructured tetrahedral grids by Edelsbrunner, et al. [69, 68]. Cazals, Chazal and Lewiner used the Morse complex for molecular shape analysis in [49]. As described in Section 3, our work uses the Morse complex to aid in the curation of molecular surfaces.

2.5 Signed Distance Function and Critical Points of Discrete Distance Functions

The key ingredient of our algorithm in ranking the topological features of the extracted is the distance function over R3. The distance function has been used earlier for reconstruction and image feature identification [20, 50, 66, 85, 189]. Chazal and Lieutier [52] have used it for stable medial axis construction. Dey, Giesen and Goswami have used distance function for object segmentation and matching [63]. Goswami, Dey and Bajaj have used it for detailed feature analysis of shape via an annotation of flat and tubular features in addition to shape segmentation [90]. Recently, Bajaj and Goswami have shown a novel use of distance function, induced by a molecular surface, in order to detect secondary structural motifs of a protein molecule [25]. The close connection between the critical point structure of the distance function and the topology of the surface and its complement is what we utilize to detect and remove small topological artifacts. In this context, Σ is the extracted isosurface. For the ease of computation, we approximate hΣ by hP which assigns to every point in R3, the distance to the nearest point from the set P which finitely samples Σ.

3 hP : R R, x min x p → 7→ p∈P k − k With our extracted isosurface, we make use of the distance function introduced above. Given a compact surface Σ smoothly 3 3 embedded in R , a distance function hΣ can be designed over R that assigns to each point its distance to Σ.

3 hΣ : R R, x inf x p → 7→ p∈Σ k − k

We identify the maxima and index 2 saddle points of hP which lie outside the level set. The stable manifolds of these critical points help detect the tunnels and the pockets of Σ. Additionally, these stable manifolds are used to compute geometric attributes of the detected topological features to which they correspond. In this way, we obtain a description of the isosurface, 2.6. COMPLEMENTARY SPACE TOPOLOGY AND GEOMETRY 29 and its complement, in terms of its topological features. These features are quantified by their geometric properties and may be selectively removed. 3 The function hP induces a flow at every point x R and this flow has been characterized earlier [85, 90]. See also [66]. ∈ The critical points of hP are those points where hP has no non-zero gradient along any direction. These are the points in 3 R which lie within the convex hull of its closest points from P . It was shown by Siersma [168] that the critical points of hP are the intersection points of the Voronoi objects with their dual Delaunay objects.

Maxima are the Voronoi vertices contained in their dual tetrahedra, • Index 2 saddles lie at the intersection of Voronoi edges with their dual Delaunay triangles, • Index 1 saddles lie at the intersection of Voronoi facets with their dual Delaunay edges, and • Minima are the sample points themselves as they are always contained in their Voronoi cells. • In this discrete setting, the index of a critical point is the dimension of the lowest dimensional Delaunay simplex that contains the critical point. 3 At every x R , a unit vector can be assigned that is oriented in the direction of the steepest ascent of hP . The critical ∈ points are assigned zero vectors. This vector field, which may not be continuous, nevertheless induces a flow in R3. This flow 3 tells how a point x moves in R along the steepest ascent of hP and the corresponding path is called the orbit of x. For a critical point c its stable manifold is the set of points whose orbits end at c. The stable manifold of a maximum is a three dimensional polytope whose boundary is composed of the stable manifolds of the index 2 saddle points which in turn are bounded by the stable manifolds of index 1 saddle points and minima. See [63, 85] for the detailed discussion on the structure and computation of the stable manifolds of the critical points of hP .

2.6 Complementary space topology and geometry

Compactifying Complementary Space A molecular surface S bounds a finte portion of R3, viz. the interior volume V of the molecule. The comple- mentary space, defined to be R3 V , contains useful geometric and topological information about the surface − such as the number of connected components and number of tunnels passing through the surface. Since R3 V is unbounded, we compactify complementary space to get a handle on these features by using some results from− Morse theory.

We construct an approximation of the Morse complex for hΣ described in Section 2.5 based on the critical points known for hP . First we describe the classification of the requisite critical points and then describe how they are clustered together. The critical points of hP are detected by checking the intersection of the Voronoi and its dual Delaunay diagram of the point set P sampled from Σ. The critical points are primarily of three types depending on if the Voronoi/Delaunay object involved lies interior to Σ, exterior to Σ, or if the Voronoi object crosses Σ. There are some exceptions: maxima can not lie on the surface and therefore come in only two types - interior and exterior. The minima are sample points themselves and therefore they are always on Σ. The saddle points can be any of three types mentioned above. Since the Morse complex we construct requires only the maxima and index 2 saddles exterior to or on the surface Σ, we fix three classes of critical points:

C2,E = index 2 saddles of hP exterior to Σ { } C2,S = index 2 saddles of hP on the surface Σ { } C3,E = maxima of hP exterior of to Σ { }

We include a point at infinity denoted (m∞) in the set C3,E to compactify the copmlementary space structure. As discussed in section 2.4, the points in the above classes come with a natural hierarchical structure based on stable manifolds. We construct a graph on the points based on this structure by the following rule: a maxima m C3,E is connected ∈ to a saddle s C2,E C2,S if and only if the stable manifold of s lies on the boundary of the stable manifold of m. We use this graph to detect∈ tunnels∪ and pockets. The algorithm is depicted visually in Figure 2.1. 30 CHAPTER 2. SETS, FUNCTIONS AND MAPPINGS

(a) (b) (c)

Figure 2.1: A visual depiction of our tunnel and pocket detection algorithm. An imaginary molecular surface is shown with a 3-mouth tunnel and a single pocket. (a) Critical points of hP are detected. Blue points are index 2 saddles and brown points are maxima. (b) A point at infinity is added and a graph constructed based on adjacency of stable manifolds. This graph approximates the Morse complex. (c) Breaking the edges to the point at infinity, we detect the tunnel (yellow with red mouths) and pocket (green with purple mouth).

2.6.1 Detection of Tunnels and Pockets

We first show that the graph constructed on the critical points of hP has B0 + 1 components where B0 is the 0-th Betti number. Any critical point inside a tunnel or pocket of the surface will have a path along the graph to m∞, the maximum at infinity. This reflects the fact that there is, by definition, a “way out” from a tunnel or pocket. A critical point in a void, on the other hand, will not have a path to m∞ and thus lies in a component separate from the tunnels and pockets. Since B0 equals the number of voids captured by the surface, the graph has exactly B0 + 1 components. Hence, the voids of Σ are precisely the stable manifolds of the components not containing m∞. With the component of the graph containing m∞, we cluster it into tunnels and pockets as follows. Observe that the point m∞ is connected only to index 2 saddles that lie on the mouth of a tunnel or pocket. Therefore, by “chopping around” the point m∞, we break apart the graph based on tunnels and pockets. More precisely, let C2,∞ C2,E C2,S denote the set of points ⊂ ∪ connected to m∞. Removing all the edges from the point m∞, we are left with n components of the graph, one corresponding to each tunnel or pocket of Σ. The stable manifolds of the points of C2,∞ form the mouths of the tunnels and pockets and we can now classify all components of our modified graph as follows.

0 Mouth indicates that the component belongs to a void. • 1 Mouth indicates that the component belongs to a pocket. • k 2 Mouths indicate the component belongs to a tunnel. We call it a k-mouthed tunnel. • ≥ We use the algorithms described in [85] for computation of the stable manifolds of index 2 saddles. In order to have a computational description of the detected features, we also compute the stable manifolds of the maxima falling into every component using the algorithm described in [63]. This produces a tetrahedral decomposition of the features captured. We compute the pockets, tunnels and voids of the molecular surface. The tetrahedral solids describing the pockets and tunnels provide a nice handle to those features and using these handles, the features can be ranked. We primarily use the geometric attributes of the features in order to rank them. Such attributes include, but are not limited to, the combined volume of the tetrahedra and the area of the mouths. The pockets and tunnels are then sorted in order of their increasing geometrically measured importance. 2.6. COMPLEMENTARY SPACE TOPOLOGY AND GEOMETRY 31

Isocontour Selection Contour Tree

Figure 2.2: Results: Top row shows the interface selection for Rieske Iron-sulphur Protein molecule (PDB ID: 1RIE) from a blurred density map. Bottom row shows the isosurface selection for the virus particle (GroEL) from cryo-EM density map.

Removal of insignificant features are also made easy because of the volumetric description of the features. As dictated by the applications, a cut-off is set below which the features are considered noise. We remove the topological noise by marking the outside tetrahedra as inside and updating the surface triangles. We show the results of our algorithm on two volumetric data. The top row in Figure 2.2 shows the electron density volume of Rieske Iron-Sulphur Protein (Protein Data Bank Id: 1RIE). The volume rendering using VolRover [59] is shown in the leftmost subfigure. The tool additionally supports the visualization and isosurface selection using CT. The other subfigures show the selected interface and the detected tunnels and pockets. Note, the mouth of the tunnel is drawn in red and the mouth of the pocket is drawn in purple. The rest of the tunnel surface is drawn in yellow while the pocket surface is drawn in green. The blue patches in the rightmost subfigure shows the filling of the smaller tunnels and pockets. The second row shows the results on the three dimensional scalar volume representing the electron density of the reconstructed image of a virus (GroEL) from a set of two dimensional electron micrographs. The resolution is 8rA. Using VolRover, a suitable level set is chosen. Note the CT is very noisy and has many branches, because of which it is not possible to extract a single-component isosurface. Nevertheless only one component is vital and the rest of them are merely artifacts caused by noise. The main component along with the detected tunnel is shown next. The result is particularly useful in visualizing the symmetric structure of the virus particle as depicted in the symmetric set of mouths. In addition to detecting the principal topological feature, the algorithm detects few small tunnels and pockets which are shown separately for visual clarity (rightmost subfigure) and these are removed subsequently as part of the topological noise removal process. However, so far we have discussed about curating the molecular surface by modifying only the complementary space topological features. This does not always serve the purpose. Consider a very thin interior surrounding a wide tunnel. The tunnel is significant but the thin portion surrounding it should disappear which we have not taken into account so far. Figure 2.3 shows a similar scenario where the inherent symmetry of the 3D map of nodavirus is shown in subfigure (a). Subfigure (b) shows that due to wrong choice of isovalue only 4 mouths are open in the complementary space tunnel of a 5-fold symmetric region. To curate this surface, modification of the complementary space is not sufficient. To deal with such cases, we extend the curation process by detecting “thin” regions in the primal space. Remarkably, distance function plays a very important role here also. In order to detect the thin regions, we first compute the interior medial axis by publicly available software [56]. Further we compute the index 1 (U1)and index 2 (U2) saddle points which lie on the interior medial axis and compute their unstable manifols using the algorithm described in [90]. U2 produces 32 CHAPTER 2. SETS, FUNCTIONS AND MAPPINGS

(b) (a)

(c) (d)

Figure 2.3: Identification of “thin” regions in the primal space. (a) The volume rendering of 3D image of nodavirus. (b) Tunnels are detected for the initial selection of the isosurface. Note, in some places of 5-fold symmetry, only 4 mouths of the tunnel are present. (c) The thin regions (blue) are identified as subsets of the unstable manifolds of the index 1 saddles identified on the interior medial axis. The arrow between (b) and (c) indicate that the places where the 5th mouth of the tunnel should open indeed have thin regions. (d) The final selected isosurface has complementary space topology consistent with the inherent symmetry of the 3D map. 2.7. ALGEBRAIC FUNCTIONS 33

linear subset of the medial axis and U1 produces planar subset of the medial axis. We then sample the distance function on U1 and U2 and identify the subset corresponding to the “thin” regions measured by a suitable threshold parameter. Figure 2.3 (c) shows the thin regions (blue patches) on the U1 (green) identified for noda virus. The reason for not using medial axis directly is that medial axis tends to be noisy and U1 and U2 usually describes the subset of the medial axis stable against the small undulation on the surface. Then we collect the interior maxima falling into the thin subset of U1 and U2 and compute their stable manifolds. Again, the stable manifolds are the collection of tetrahedra and therefore we cut the surface open by forming a channel interior to the volume bounded by the molecular surface by appropriately toggling the marking of the tetrahedra from inside to outside. Final selection of the isosurface for which the mouths of the tunnels respect the inherent symmetry of the density map of the virus is shown in Figure 2.3 (d).

2.7 Algebraic Functions

2.7.1 Polynomial and Rational Parametric Algebraic , Surfaces Algebraic and Semi-algebraic sets Elimination theory, Resultants

n A point in complex projective space CP is given by a nonzero homogeneous coordinate vector (X0,X1,...,Xn) of n + 1 n complex numbers. A point in complex affine space CA is given by the non-homogeneous coordinate vector (x1, x2, . . . , xn) = ( X1 , X2 ,..., Xn ) of n complex numbers. The set of points Zn(f) of CAn whose coordinates satisfy a single non- X0 X0 X0 d homogeneous polynomial equation f(x1, x2, . . . , xn) = 0 of degree d, is called an n 1 dimension, affine hypersurface n n − of degree d. The hypersurface Z1 (f) is also known as a flat or a hyperplane, a Z2 (f) is known as a quadric hypersurface, n 2 3 and a Z3 (f) is known as a cubic hypersurface. The hypersurface Zd is a of degree d, a Zd is known as a 4 n surface of degree d, and Zd is known as a threefold of degree d. A hypersurface Zd is reducible or irreducible based upon n whether f(x1, x2, ..., xn) = 0 factors or not, over the field of complex numbers. An algebraic variety Z {f1, ..., fn} is then an irreducible common intersection of a collection of hypersurfaces Zn (f ). di i n An irreducible rational hypersurface Zd (f), can additionally be defined by rational parametric equations which are given as (x1 = G1(u1, u2, . . . , un−1), x2 = G2(u1, u2, . . . , un−1), ..., xn = Gn(u1, u2, . . . , un−1)), where G1, G2, ..., Gn are rational functions of degree d in u = (u1, u2, . . . , un−1), i.e., each is a quotient of polynomials in u of maximum degree d. Multi-polynomial Resultant: Consider F1 = 0, ..., Fm = 0 polynomial equations in n + 1 variables (X0, ..., Xn) and homogeneous in m variables (X0, ..., Xm−1). These equations could be the homogenization of the earlier system (2.21) with X0 acting as the homogenizing variable. The multi-polynomial resultant R(F1, ..., Fm) is a polynomial in the coefficients of the Fi that vanishes if and only if the Fi have a common zero in projective space. For this reason, the resultant is also often called n the eliminant. Geometrically, the resultant vanishes if and only if the n hypersurfaces Zd (Fi) have a common intersection in projective space. The resultant of several equations has several different characterizations. Probably the most elegant was discovered by Macaulay [126]. He shows that the multi-polynomial resultant can be expressed as the quotient of the determinant of two matrices whose entries are coefficients of the polynomials. In the case of two equations, the matrix for the denominator always has determinant 1 and the matrix for the numerator is the traditional Sylvester matrix[153]. In computing the multi-polynomial resultant, the Fi are multiplied by suitable monomials to transform the problem of determining whether the polynomials have a common zero into a problem in linear algebra. We construct a matrix whose entries are the coefficients of the F1, ..., Fm. The determinant of this matrix will be the product of the resultant and the determinant of a specific minor of the matrix. The general construction due to [126] is as follows: In the system F1 = 0, ..., Fm = 0 of polynomial equations, homogenous in variables X0, ..., Xm−1, let Fi be of degree di. The coefficients of the Fi’s are treated as indeterminates. Let X d = 1 + (di 1). − and let the m-vector α denote the exponents of a monomial in X0, ..., Xm−1. For example, if α = (α0, ..., αm−1), then

α α0 αm−1 X = X0 ...Xm−1 . 34 CHAPTER 2. SETS, FUNCTIONS AND MAPPINGS

Thus, the set of all monomials of degree d in m variables is

d α = X α0 + ... + αm−1 = d. X { | } If N denotes the number of monomials in this set, then the monomials will index the columns of an N by N matrix.

 d + m 1  N = d −

Partition d into n disjoint sets. These sets are X d α = X αi di and αj < dj , j < i . Xi { | ≥ ∀ } d d d Next, for each set , construct a set F of polynomials from Fi using monomials in . Specifically, let Xi i Xi d d i F = X fi. i di xi

d The Fi are sets of homogeneous polynomials in m variables of degree d. Moreover, each of the polynomials in the union d of the Fi , equated to zero, collectively yields a set of N homogeneous polynomial equations. Construct an N by N matrix d d (call it A) whose columns are indexed by monomials in and whose rows correspond to the polynomials in the Fi ’s. For a d X given polynomial P in Fi , its row consists of the symbolic coefficients aik, bjk etc., of each monomial in P .

 d     d    X0 . ai1 ai2 ai3 .... X0 0  .   . . bj1 bj2 bj3 ...   .   .          A  .  =  ......   .  =  .  (2.1)          .   ......   .   .  d d Xm−1 ...... Xm−1 0

ˆ ˆ d Now, if the Fi have a common root (X0, ..., Xm−1), then this root must satisfy all of the polynomial equations in the Fi ’s. This fact implies that the nontrivial vector (Xˆ0, ..., Xˆm−1) must be in the null space of A. Thus, A must be singular or equivalently, the determinant of A (call it D) must be zero. This argument establishes that the resultant R is a factor of D. The remaining factors of D are extraneous and have no bearing on whether the original equations have a common root. The beauty of Macaulay’s result is that he established that the extraneous factors are the determinant of a minor of A. This minor (call it B) α can be constructed from A in the following manner. Delete all columns of A that correspond to monomials X where αi < di for all but one value of i. (Note there must at least one such i due to the manner in which d was chosen.) Delete all rows of A α that correspond to polynomials in Fi whose multipliers X have αj < dj for i < j n. Macaulay shows that the resultant R satisfies ≤ det(A) R = det(B) where this division is carried out before the indeterminates forming the entries of A and B are specialized. The reason for specializing after division is that det(A) and det(B) may evaluate to zero even though R is not identically zero. Techniques for computing R by specializing before division has recently been considered in [47, 147]. Multi-polynomial Remainder Sequence: Consider first two polynomial equations f1(x1, . . . , xn) = 0 and f2(x1, . . . , xn) = 0. Treating them as polynomials in x1, the psuedo-remainder (f1/f2) = g(x1, . . . , xn) for degreex (f2) degreex (f1), is the 1 ≤ 1 result of one step of psuedo-division in the ring C of coefficient polynomials in n 1 variables (x2, . . . , xn), i.e. αf1 = βf2 g − − with α, βC and degreex1 (g) < degreex1 (f2). Repeating the psuedo-division with f2 and g and ensuring that the factors α and β are ‘primitve’, one can compute a subresultant polynomial remainder sequence (p.r.s):

f1, f2, g = Sk−1,...,S1,S0 (2.2)

th where Si is the psuedo-remainder of the two polynomials preceding it in the sequence and is known as the i subresultant of f1 and f2, with respect to x1, see for e.g [106, 125]. Here S0 is a polynomial independent of x1 and is the resultant of f1 and f2, with respect to x1. (Note in the homogeneous case S0 is the polynomial resultant of F1 and F2, with respect to X0 and X1. 2.7. ALGEBRAIC FUNCTIONS 35

Figure 2.4: Cartan Surface f = x2 yz2 = 0 with a triple point singularity at (0, 0, 0) and a double line singularity defined by (x = 0, z = 0) −

For the set of polynomial equations ( 2.21), treating them as polynomials in x1, we select the polynomial, say fk, of minimum degree in x1. We then compute the subresultant psuedo-remainder for each pair (fi/fk) = gi, 1 i m and ≤ ≤ i = k, yielding a new system of equations gi and fk. We repeat the above, first selecting from the new system, a polynomial of 6 minimum degree in x1, and then computing pairwise subresultant psuedo-remainders. Eventually, we obtain a system of m 1 polynomial equations, say Sm−1 − ˜ f1(x2, ..., xn) = 0 ... ˜ fm−1(x2, ..., xn) = 0 (2.3) independent of x1. The above is then one (macro) step of the multi-equational polynomial remainder sequence (m.p.r.s). For the new set of polynomial equations (2.24), treating them as polynomials in x2, we repeat the entire process above and obtain yet another m−2 reduced system S of m 2 polynomial equations, all independent of x2, and so on. This sequence of systems of multi- equational polynomial equations−

S = Sm,Sm−1,Sm−2,...,S1,S0 (2.4) is what we term the multi-equational polynomial remainder sequence.

2.7.2 Local and Global Parameterization Singularities Singularities and Genus

Consider an irreducible plane Cd of degree d. Lines through a point P intersects Cd (outside P ) in general at d multpCd points, where multpCd = e = multiplicity of Cd at P = order at P of the polynomial equation describing Cd . The− order of a polynomial equation at a point P = (a, b), is the minimum (i + j), when the polynomial is expressed with terms i j (x a) (y b) . If e = 0: P is not on Cd. If e = 1 then P is called a simple point. If e > 1 we say P is a singular point of − − the curve Cd with multiplicity e or an e-fold point. A 2-fold point is also called a double point and a 3-fold point a triple point. (d − 1)(d − 2) By Bezout’s theorem one may see that the maximum number of double points of Cd is 2 . Further, the number (d+2)(d+1) ≤ of independent conditions needed to specify Cd is 2 1. One definition of the genus G of a curve Cd is a measure of how much the curve is deficient from its maximum allowable− limit of singularities,

(d 1)(d 2) G = − − DP (2.5) 2 − where DP is a ‘proper’ counting of the number of double points of Cd (summing over all singularities, in the projective complex plane ). 36 CHAPTER 2. SETS, FUNCTIONS AND MAPPINGS

Distinct singularities of a plane curve can computationally be obtained by simultaneously solving for the roots of the system of polynomial equations f = fx = fy = 0 where fx and fy are the x and y partial derivatives of f, respectively. One way of obtaining the common solutions is to find those roots of Resx(fx, fy) = 0 and Resy(fx, fy) = 0 which are also the roots of f = 0. Here Resx(fx, fy) ( similarly Resy(fx, fy)) is the Sylvester resultant of fx and fy treating them as polynomials in x (similarly y). For a classical treatment of the Sylvester resultant see [153]. Other methods of computing the roots of a system of polynomial equations, for example via the U resultant may also be used [146]. This method yields an overall time bound of 6 2 2 − O(d + T (d )) for computing all the O(d ) possible singularities of Cd, using the Sylvester resultant which for two j-variate polynomials of maximum degree d can be computed in O(d2jlog3d) time [33]. Note that singularities at infinity can be obtained in a similar way after replacing the line at infinity with one of the affine coordinate axes. In particular, on homogenizing f(x, y) to F (X,Y,Z) we can set Y = 1 to obtain f˜(x, z) thereby swapping the line at infinity Z = 0 with the line Y = 0. Now the ˜ ˜ ˜ above computation of roots can be applied to f = fx = fz = 0 to compute singularities at infinity. Having computed the singular points one next obtains a proper count of the total number of double points DP of Cd.A proper counting was achieved by Noether using (projective) Cremona quadratic transformations, see [176] Following [2], the same can be achieved using (affine) quadratic transformations.

Affine Quadratic Transforms In a general procedure for counting double points, given an e-fold point P of a plane curve Cd, we choose our coordinates to bring P to the origin and then apply the quadratic transformation Q1 or Q2.

Q1 : x = x1 , y = x1y1 (2.6)

Q2 : x = x2y2 , y = y2 (2.7)

Affine quadratic transformations are centered on a singularity and affect the curve locally, allowing one to treat each singu- larity of Cd in isolation. If now Cd : f(x, y) = 0, then the quadratic transformation Q1 transforms Cd into the curve 1 C : f1(x1, y1) = 0 given by e f(x1, x1 y1) = x1 f1(x1, y1)

1 1 m i C will intersect the exceptional line E : x1 = 0 in the points P , ..., P , the roots of f1(0, y) = 0. If P is a ei-fold 1 1 m point of C , then we shall have e1 + ... + em e. The P , ..., P are termed the points of Cd in the first neighborhood of ≤ i 1 ij P . The quadratic transformations can be repeated at each of the P points of C with ei > 1, yielding points P points in the second neighborhood of P and so on. The collection of these neighborhod points are termed the points infinitely near P and form in general a singularity tree at P . At each node of this tree (including the root) keep a count equal to the multiplicity of the curve (transformed curve) at that point. The desingularization theorem for algebraic plane curves, see [2, 176], states that at every node beyond a certain level, the count equals one; in other words, C has only a finite number of singular points infinitely e(e−1) near P . Next (using Bezout) take 2 double points towards DP for a count e and sum over all nodes of a singularity tree and additionally over all singularities of Cd and their corresponding singularity trees, to obtain a precise count for the total number of double points DP of Cd. This proper counting of double points then yields the genus of Cd via the above genus formula, (1). 6 2 2 Theorem 2.1: The Genus G for Cd of degree d can be computed in O(d + d T (d )) time.

Proof. The time taken to compute G is bound by the time O(d6 + T (d2)) taken to compute the O(d2) possible singular points of Cd, plus the time taken by the refinement of singularities via quadratic transformations, which we now bound. As many as 2 O(d ) quadratic transformations may be needed for all infinitely near singularities of Cd where a single quadratic transformation takes O(d2) time. Then there is the O(d2 T (d2)) time spent in computing intersections with the exceptional line accounting also for a degree blowup of O(d2) for the transformed curve in a sequence of quadratic transformations. Additionally, there is the time spent in translating the singularity to the origin which entails an algebraic simplification with an overall cost of O(d4). This results in the overall time bound of O(d6 + d2 T (d2)).

There is then the concise characterization for curves having rational parametric equations

Theorem [Cayley-Riemann]: Cd has a rational parameterization iff G = 0. In other words if the given plane curve has its maximum allowable limit of singularities, then it is rational. 2.7. ALGEBRAIC FUNCTIONS 37

Parameterizing with a Pencil of Lines

From Cayley-Riemann Theorem of the earlier section, we know that all degree d curves Cd with one distinct d 1 fold − point, are rational. One way then of parameterizing these curves Cd is to symbolically intersect them with a pencil of lines (y y0) = t(x x0) through the d 1 fold point (x0, y0) on the curve. This pencil intersects Cd in only one additional point, the− coordinates of− which can be expressed− as rational functions of the parameter t. Alternatively, the same can be achieved by mapping the d 1 fold point on Cd to infinity along one of the coordinate axis. We illustrate this below. −

Mapping Points to Infinity Consider f(x, y) a polynomial of degree d in x and y representing a plane algebraic curve Cd of degree d with a distinct d 1 fold singularity. We first determine the d 1 fold singularity of the curve Cd and translate it to the origin. Then we can write− −

f(x, y) = fd(x, y) + fd − 1(x, y) = 0 where fi consists of the terms of degree i. Note that fd and fd−1 are the only terms that will exist, since a d 1 fold singularity i+j − at the origin implies that (i + j) < d 1, ∂f = 0 at (0, 0). ∀ − ∂xi∂yj On homogenizing f(x, y) we obtain

d d−1 d F (X,Y,Z) = a0Y + a1Y X + ... + adX d−1 d−2 d−1 + b0Y Z + b1Y XZ + ... + bdX Z = 0 (2.8)

Now by sending the singular point (0, 0, 1) to infinity along the Y axis we eliminate the Y d term. Algebraically this is achieved by a homogeneous linear transformation which maps the point (0, 0, 1) to the point (0, 1, 0) and is given by X = X1 ,Y = Z1 ,Z = Y1, which yields

d d−1 d F (X1,Y1,Z1) = a0Z1 + a1Z1 X1 + ... + adX1 d−1 d−2 d−1 + b0Z1 Y1 + b1Z1 X1Y1 + ... + bdX1 Y1 = 0 (2.9) Then one easily obtains

d d−1 d a0Z1 + a1Z1 X1 + ... + adX1 Y1 = d−1 d−2 d−1 (2.10) −b0Z1 + b1Z1 X1 + ... + bdX1

Letting X1 = t and dehomogenizing by setting Z1 = 1 and using the earlier homogeneous linear transformation, we construct the original affine coordinates X X x = = 1 Z Y1 Y Z y = = 1 (2.11) Z Y1 as rational functions of the single parameter t. Theorem 3.1: An algebraic plane curve of degree d with a distinct d 1 fold point can be rationally parameterized in O(d4log3d) time. − Proof. The time taken to determine the d 1-fold singularity is bound by O(d4log3d) the time taken to determine a single mutliple root of a univariate polynomial of− degree d is O(d log2d [143]. This also yields the overall time bound, since the homogeneous linear transformation after a translation of the singularity to the origin, is bound by O(d4).

Parameterizing with a Pencil of Curves

In the general case we consider a curve Cd with the appropriate number of distinct and infinitely near singularities which make Cd rational (genus 0). We pass a pencil of curves Cd−2(t) through these singular points and d 3 additional simple points of − Cd. This pencil intersects Cd in only one additional point, the coordinates of which can be expressed as rational functions of the parameter t. 38 CHAPTER 2. SETS, FUNCTIONS AND MAPPINGS

Let F (X,Y,Z) = 0 and G(X,Y,Z) = 0 be the homogeneous equations of the curves Cd and Cd−2(t) respectively. For a distinct singular point of multiplicity m of Cd at the point (Xi,Yi,Zi) we pass the curve Cd−2(t) through it with multiplicity m 1. To achieve this we equate −

G(Xi,Yi,Zi) = F (Xi,Yi,Zi) = 0 (2.12)

G j k (Xi,Yi,Zi) = F j k (Xi,Yi,Zi) = 0 , 1 j + k m 2 (2.13) X Y X Y ≤ ≤ − ∂Gj+k where GXj Y k = ∂Xj ∂Y k . Similarly for FXj Y k . For an infinitely near singular point of Cd we construct its associated singularity tree and pass the curve Cd−2(t) with multiplicity r 1 through each of the points of multiplicity r in the first, second, third, ..., neighborhoods. To achieve this − we apply quadratic transformations Ti to both F (X,Y,Z) and G(X,Y,Z) centered around the infinitely near singular points corresponding to the singularity tree. The appropriate multiplicity of passing is achieved by equating the transformed equations

FTi and GTi and their partial derivatives as above. All the above conditions in totality lead to a square system of homogeneous linear equations where the unknowns are the coefficients of Cd−2(t) having one variable parameter t. A counting argument shows that this method generates the correct number of conditions which specifies Cd−2(t) and furthermore the total intersection count between Cd and Cd−2(t) satisfies Bezout. A curve Cd of genus = 0 has the equivalent (d−1)(d−2) of exactly double points. To pass a curve Cd−2(t) through these double points and d 3 other fixed simple points 2 − of Cd, the total number of conditions (= the total number of linear equations) is given by

(d 1)(d 2) d (d 1) − − + (d 3) = − 2 2 − 2 − which is exactly the number of independent unknowns to determine a pencil of Cd−2(t). Having determined the pencil of Cd−2(t) curves we compute the resultant Resx(Cd,Cd−2(t)) which yields a polynomial of degree d(d 2) in y which on − dividing by the common factors corresponding to the (d 3) simple points and (d−2)(d−1) double points, yields a polynomial − 2 in y and t which is linear in y and thereby gives y as a rational function of t. Similarly repeating with Resy(Cd,Cd−2(t)) yields x as a rational function of t. Theorem 4.1: A rational algebraic plane curve of degree d can be rationally parameterized in O(d6log3d + d2T (d2)) time.

Proof. The time taken to compute the O(d2) point singularities with refinement for infinitely near singularitites is bound as before by the time O(d6 + d2T (d2)). The time taken to determine d 3 simple points requires at worst no more than O(d T (d)) time (most points are simple). Then there is the time taken to solve− the homogeneous linear system of size O(d2). Using a technique similar to Gaussian elimination (which requires O(d3) for a linear system of size d), the time can be bound by O(d6). Finally there is the computation of the resultants of the equations for Cd and Cd−2 involving variables x, y and t and division by univariate polynomials [8], all bound by O(d6log3d) time. Hence the overall time bound above.

Algebraic Space Curves

Consider an irreducible algebraic space curve Cd of degree d, which is implicitly defined as the intersection of two algebraic surfaces f(x, y, z) = 0 and g(x, y, z) = 0. There always exists a birational correspondence between the points of Cd and the points of an irreducible plane curve Pd of degree d, whose genus is the same as that of Cd [1]. Birational correspondence between Cd and Pd means that the points of Cd can be given by rational functions of points of Pd and vice versa (i.e there exists a 1-1 mapping between points of Cd and Pd, except for a finite number of exceptional points ). Consequently, knowing how to compute the genus and rational parameterization of algebraic plane curves from sections 2, 3 and 4, yields an algorithm to compute the genus of the space curve Cd and if genus = 0 the rational parametric equations of Cd. To determine the equation of the plane curve Pd we consider the projection of the space curve Cd along one of the coordinate axis. Projecting Cd along, say the z axis, can be achieved by treating both f and g as polynomials in z with coefficients in x and y and then computing the Sylvester resultant. The resultant yields a polynomial in the coefficients of f and g, viz., a plane curve Pd described by the polynomial in x and y. However this projected plane curve Pd in general, is not in birational correspondence with the space curve Cd. For a chosen projection direction it is quite possible that most points of Pd may correspond to more than one point of Cd (i.e. a multiple covering of Pd by Cd). However this may be rectified by choosing a valid projection direction. 2.7. ALGEBRAIC FUNCTIONS 39

Valid Projection Direction To find an appropriate axis of projection, the following general procedure may be adopted. Con- sider the linear transformation x = a1x1 + b1y1 + c1z1, y = a2x1 + b2y1 + c2z1 and z = a3x1 + b3y1 + c3z1. On substituting into the equations of the two surfaces defining the space curve we obtain the transformed equations f1(x1, y1, z1) = 0 and g1(x1, y1, z1) = 0. Next compute the Resz1 (f1, g1) which yields a polynomial h(x1, y1) which is the equation of the pro- jected plane curve. Choose the coefficients of the linear transformation, ai, bi and ci such that (i) the determinant of ai, bi and ci is non zero and (ii) the equation of the projected plane curve h(x1, y1) is not a power of an irreducible polynomial. The latter can be achieved by making the discriminant Resx1 (h, hx1 ) to be non zero. Such a choice of coefficients ensures that the projected irreducible plane curve given by h(x1, y1) is in birational correspondence with the irreducible space curve and thus of the same genus. As "bad" values for ai, bi, ci, i = 1 ... 3, satisfy a lower dimension hypersurface, any random choice of values will suffice with probability 1, see [162].

Constructing the Birational Map There remains the problem of constructing the birational mapping between points on Pd and Cd. Let the projected plane curve Pd be defined by the polynomial h(x1, y1). The map one way is linear and is given trivially by x1 = x and y1 = y. To construct the reverse rational map one only needs to compute z = I(x1, y1) where I is a rational function. We now show how it is always possible to construct this rational function by use of a polynomial remainder sequence along a valid projection direction. Let the surfaces f(x, y, z) = 0 and g(x, y, z) = 0 be of degrees m1 and m2 respectively. Without loss of generality let this direction be the z axis and that m1 m2. Both m1 and m2 are bound by d, the degree of the space curve Cd. Let ≥ F1 = f(x, y, z) and F2 = g(x, y, z) be given by

m1 m1−1 F1 = f0 z + f1 z + ... + fm1−1 z + fm1 m2 m2−1 F2 = g0 z + g1 z + ... + gm2−1 z + gm2 (2.14) with fj,(j = 0 ... m1) and gk,(k = 0 ... m2), denoting polynomials in x, y. Then, there exist polynomials Fi+2(x, y, z), for i = 1 ... k, such that Ai Fi = Qi Fi+1 + Bi Fi+2 where mi+2, the degree of z in Fi+2, is less than mi+1, the degree of z in Fi+1 and certain polynomials Ai(x, y), Qi(x, y, z) and Bi(x, y). The polynomials Fi+2, i = 1, 2, ... form, what is known as a polynomial remainder sequence ( PRS ) and can be computed in various different ways [125]. We choose the subresultant PRS scheme for its computational superiority and also because each Fi = Smi−1−1, 1 i r, where Sk is the th ≥ ≥ k subresultant of F1 and F2. This together with making the z axis a valid projection direction ensures that in the polynomial remainder sequence there exists a polynomial remainder which is linear in z, i.e., Fr−1 = zΦ1(x, y) Φ2(x, y) = 0. This then yields z as a rational function of x and y and the inverse rational map. − Theorem 5.1: For an irreducible algebraic space curve Cd, the equations of the birational map and the projected plane 6 3 curve Pd can be computed in O(d log d) time.

Proof. The time for computing the valid projection direction via a random choice of values and the above polynomial remainder sequence is bound by the resultant computation for the projection.

This together with Theorems 2.1 and 4.1 yields Corollary 5.2: The genus of an algebraic space curve of degree d and the parametric equations of a rational space curve of degree d can be computed in O(d6log3d + d2T (d2)) time.

Faithful Parameterizations

Given a polynomial parameterization

m m − 1 x = P (t) = amt + am − 1t + ... + a0 n n − 1 y = Q(t) = bnt + bn − 1t + ... + b0 (2.15) of an affine algebraic curve f(x, y) we now give an algorithm to check if the parameterization is faithful, i.e., for all but a finite number of points of the curve there corresponds a single parameter value and vice versa. Both m and n are bound by the degree 40 CHAPTER 2. SETS, FUNCTIONS AND MAPPINGS d of the plane curve. Take the Taylor expansion with a single shift and let

P (t+τ) − P (t) ! τ C(t) = Resτ Q(t+τ) − Q(t) (2.16) τ  (1) 1 (2) 1 (m) m−1  P (t) + 2 P (t)τ +... + m! P (t)τ = Resτ (1) 1 (2) 1 (n) n−1 (2.17) Q (t) + 2 Q (t)τ +... + n! Q (t)τ where P k is the kth derivative of P . Similarly for Qk. Then C(t) = 0 if and only if the parameterization is faithful. Further, if C(t) is a nonzero polynomial, its roots give the singular points6 with multiplicities of the affine curve. Finally, if C(t) is a non-zero constant then the affine plane curve is non-singular, or equivalently, since the curve is of genus 0, the curve has a single d 1 fold singularity at infinity. For a rational parameterization −

P (t) x = R(t) Q(t) y = (2.18) R(t) of f(x, y), again take the Taylor expansion with a single shift and let

P (t+τ)R(t)−R(t+τ)P (t) ! τ C(t) = Resτ Q(t+τ)R(t)−R(t+τ)Q(t) (2.19) τ  R(t)P (1)(t) P (t)R(1)(t) + 1 (R(t)P (2)(t) P (t)R(2)(t))τ + ...  = Res 2 (2.20) τ R(t)Q(1)(t) − Q(t)R(1)(t) + 1 (R(t)Q(2)(t) − Q(t)R(2)(t))τ + ... − 2 − Then again C(t) = 0 if and only if the parameterization is faithful. Theorem 6.1: The6 faithfulness of parameterizations as well as the singularities of parameterically defined algebraic curves of degree d can be computed in O(d4log3d) time.

Proof. The time for the Taylor expansion is at most O(d2) and is bound by the time taken to compute the resultant.

Intersection of Surfaces Background: Current research in geometric modeling is engaged in extending the geometric coverage of solid modelers using polynomial equations of arbitrarily high degree. Effectively manipulating these geometric representations require the ability to manipulate the underlying systems of equations [14, 110]. The set of solutions (or zero set Z(S)) of a collection S of polynomial equations

S1 : f1(x1, ..., xn) = 0 ...

Sm : fm(x1, ..., xn) = 0 (2.21) is referred to as an algebraic set. Algorithms for manipulating algebraic sets are crucial components for proof systems deciding existential and universal theories of polynomial equations, see for e.g. [147]. An algebraic set that cannot be represented as the union of two other distinct algebraic sets, neither containing the other, is said to be irreducible. An irreducible algebraic set is also known as an algebraic variety. One computational method for manipulating algebraic sets Z(S) is that of Gröbner basis manipulations [45]. Given the set of polynomials F = f1, ..., fm , the Gröbner basis algorithms provide a deterministic iterative method for determining { } P whether a polynomial P lies in the set of all polynomials of the form aifi (the ideal of F ). It collectively manipulates the combinatorial structure of the entire set F of polynomials and in doing so, indirectly provides answers to questions about the zero set Z(S). 2.7. ALGEBRAIC FUNCTIONS 41

Geometric problems dealing with zero sets Z(S), such as the intersection of surfaces, or the decision whether a surface contains a set of curves, are often first versed in an ideal-theoretic form and then solved using Gröbner basis manipulations. One of the main difficulties involved in using the indirect Gröbner basis technique is that the method may be extremely slow for even small geometric problems. In the worst case, this method requires exponential space and may have running time that is double exponential in the number of variables in problem [130]. Even in special cases where this double exponential behavior is not observed, deriving tight upper bounds on the method’s running time is difficult. We present an alternative technique for answering various geometric questions on algebraic varieties of degrees two and three. (We shall define the degree of the algebraic variety in section 2.7.2). The technique of constructing rational maps of algebraic varieties with hyperplanes, that we present, deals directly with the zero sets of polynomial equations (rather than just the combinatorial structure of the polynomials). Such rational maps provide a compact data structure for algebraic varieties and also yield simpler algorithms for computing intersections[26], shading, displaying and texture mapping[17], and in general solving systems of algebraic equations[34]. It is based, though not entirely, on lesser known constructs of algebraic geom- etry, namely the multi-polynomial resultant[126] and multi-polynomial remainder sequences (a generalization of remainder sequences of two polynomials, see for e.g., [106, 125]). These computations can be done in time single exponential in the number of indeterminates of the equations. Main Results: In section 2.7.2 we present a method of computing the degree of an algebraic variety. This essentially relies on a way of computing a hypersurface birational to the given variety, via a valid projection direction along which the projection map is one-to-one. In section 2.7.2 we show how to construct the rational inverse of the one-to-one projection map between the hypersurface and the algebraic variety, using either multi-polynomial resultants or multi-polynomial remainder sequences. In section ?? we build on the earlier results of one-to-one maps and present an algorithm to construct the rational parametric equations (a rational map from points on a hyperplane) for implicitly defined algebraic varieties of degrees two and three. This is based on sub-algorithms for parameterizing arbitrary dimension ( 3) hypersurfaces of these degrees. ≥

Notation and Preliminaries

n A point in complex projective space CP is given by a nonzero homogeneous coordinate vector (X0,X1,...,Xn) of n + 1 n complex numbers. A point in complex affine space CA is given by the non-homogeneous coordinate vector (x1, x2, . . . , xn) = ( X1 , X2 ,..., Xn ) of n complex numbers. The set of points Zn(f) of CAn whose coordinates satisfy a single non- X0 X0 X0 d homogeneous polynomial equation f(x1, x2, . . . , xn) = 0 of degree d, is called an n 1 dimension, affine hypersurface n n − of degree d. The hypersurface Z1 (f) is also known as a flat or a hyperplane, a Z2 (f) is known as a quadric hypersurface, n 2 3 and a Z3 (f) is known as a cubic hypersurface. The hypersurface Zd is a plane curve of degree d, a Zd is known as a 4 n surface of degree d, and Zd is known as a threefold of degree d. A hypersurface Zd is reducible or irreducible based upon n whether f(x1, x2, ..., xn) = 0 factors or not, over the field of complex numbers. An algebraic variety Z {f1, ..., fn} is then an irreducible common intersection of a collection of hypersurfaces Zn (f ). di i n An irreducible rational hypersurface Zd (f), can additionally be defined by rational parametric equations which are given as (x1 = G1(u1, u2, . . . , un−1), x2 = G2(u1, u2, . . . , un−1), ..., xn = Gn(u1, u2, . . . , un−1)), where G1, G2, ..., Gn are rational functions of degree d in u = (u1, u2, . . . , un−1), i.e., each is a quotient of polynomials in u of maximum degree d.

Multi-polynomial Resultant: Consider F1 = 0, ..., Fm = 0 polynomial equations in n + 1 variables (X0, ..., Xn) and homogeneous in m variables (X0, ..., Xm−1). These equations could be the homogenization of the earlier system (2.21) with X0 acting as the homogenizing variable. The multi-polynomial resultant R(F1, ..., Fm) is a polynomial in the coefficients of the Fi that vanishes if and only if the Fi have a common zero in projective space. For this reason, the resultant is also often called n the eliminant. Geometrically, the resultant vanishes if and only if the n hypersurfaces Zd (Fi) have a common intersection in projective space. The resultant of several equations has several different characterizations. Probably the most elegant was discovered by Macaulay [126]. He shows that the multi-polynomial resultant can be expressed as the quotient of the determinant of two matrices whose entries are coefficients of the polynomials. In the case of two equations, the matrix for the denominator always has determinant 1 and the matrix for the numerator is the traditional Sylvester matrix[153]. In computing the multi-polynomial resultant, the Fi are multiplied by suitable monomials to transform the problem of determining whether the polynomials have a common zero into a problem in linear algebra. We construct a matrix whose entries are the coefficients of the F1, ..., Fm. The determinant of this matrix will be the product of the resultant and the determinant of a specific minor of the matrix.

The general construction due to [126] is as follows: In the system F1 = 0, ..., Fm = 0 of polynomial equations, homogenous 42 CHAPTER 2. SETS, FUNCTIONS AND MAPPINGS

in variables X0, ..., Xm−1, let Fi be of degree di. The coefficients of the Fi’s are treated as indeterminates. Let X d = 1 + (di 1). − and let the m-vector α denote the exponents of a monomial in X0, ..., Xm−1. For example, if α = (α0, ..., αm−1), then

α α0 αm−1 X = X0 ...Xm−1 . Thus, the set of all monomials of degree d in m variables is

d α = X α0 + ... + αm−1 = d. X { | } If N denotes the number of monomials in this set, then the monomials will index the columns of an N by N matrix.

 d + m 1  N = d −

Partition d into n disjoint sets. These sets are X d α = X αi di and αj < dj , j < i . Xi { | ≥ ∀ } d d d Next, for each set , construct a set F of polynomials from Fi using monomials in . Specifically, let Xi i Xi d d i F = X fi. i di xi

d The Fi are sets of homogeneous polynomials in m variables of degree d. Moreover, each of the polynomials in the union d of the Fi , equated to zero, collectively yields a set of N homogeneous polynomial equations. Construct an N by N matrix d d (call it A) whose columns are indexed by monomials in and whose rows correspond to the polynomials in the Fi ’s. For a d X given polynomial P in Fi , its row consists of the symbolic coefficients aik, bjk etc., of each monomial in P .

 d     d    X0 . ai1 ai2 ai3 .... X0 0  .   . . bj1 bj2 bj3 ...   .   .          A  .  =  ......   .  =  .  (2.22)          .   ......   .   .  d d Xm−1 ...... Xm−1 0

ˆ ˆ d Now, if the Fi have a common root (X0, ..., Xm−1), then this root must satisfy all of the polynomial equations in the Fi ’s. This fact implies that the nontrivial vector (Xˆ0, ..., Xˆm−1) must be in the null space of A. Thus, A must be singular or equivalently, the determinant of A (call it D) must be zero. This argument establishes that the resultant R is a factor of D. The remaining factors of D are extraneous and have no bearing on whether the original equations have a common root. The beauty of Macaulay’s result is that he established that the extraneous factors are the determinant of a minor of A. This minor (call it B) α can be constructed from A in the following manner. Delete all columns of A that correspond to monomials X where αi < di for all but one value of i. (Note there must at least one such i due to the manner in which d was chosen.) Delete all rows of A α that correspond to polynomials in Fi whose multipliers X have αj < dj for i < j n. Macaulay shows that the resultant R satisfies ≤ det(A) R = det(B) where this division is carried out before the indeterminates forming the entries of A and B are specialized. The reason for specializing after division is that det(A) and det(B) may evaluate to zero even though R is not identically zero. Techniques for computing R by specializing before division has recently been considered in [47, 147]. Multi-polynomial Remainder Sequence: Consider first two polynomial equations f1(x1, . . . , xn) = 0 and f2(x1, . . . , xn) = 0. Treating them as polynomials in x1, the psuedo-remainder (f1/f2) = g(x1, . . . , xn) for degreex (f2) degreex (f1), is the 1 ≤ 1 result of one step of psuedo-division in the ring C of coefficient polynomials in n 1 variables (x2, . . . , xn), i.e. αf1 = βf2 g − − 2.7. ALGEBRAIC FUNCTIONS 43

with α, βC and degreex1 (g) < degreex1 (f2). Repeating the psuedo-division with f2 and g and ensuring that the factors α and β are ‘primitve’, one can compute a subresultant polynomial remainder sequence (p.r.s):

f1, f2, g = Sk−1,...,S1,S0 (2.23)

th where Si is the psuedo-remainder of the two polynomials preceding it in the sequence and is known as the i subresultant of f1 and f2, with respect to x1, see for e.g [106, 125]. Here S0 is a polynomial independent of x1 and is the resultant of f1 and f2, with respect to x1. (Note in the homogeneous case S0 is the polynomial resultant of F1 and F2, with respect to X0 and X1. For the set of polynomial equations ( 2.21), treating them as polynomials in x1, we select the polynomial, say fk, of minimum degree in x1. We then compute the subresultant psuedo-remainder for each pair (fi/fk) = gi, 1 i m and ≤ ≤ i = k, yielding a new system of equations gi and fk. We repeat the above, first selecting from the new system, a polynomial of 6 minimum degree in x1, and then computing pairwise subresultant psuedo-remainders. Eventually, we obtain a system of m 1 polynomial equations, say Sm−1 − ˜ f1(x2, ..., xn) = 0 ... ˜ fm−1(x2, ..., xn) = 0 (2.24) independent of x1. The above is then one (macro) step of the multi-equational polynomial remainder sequence (m.p.r.s). For the new set of polynomial equations (2.24), treating them as polynomials in x2, we repeat the entire process above and obtain yet another m−2 reduced system S of m 2 polynomial equations, all independent of x2, and so on. This sequence of systems of multi- equational polynomial equations−

S = Sm,Sm−1,Sm−2,...,S1,S0 (2.25) is what we term the multi-equational polynomial remainder sequence.

Birational Hypersurface and Degree Computation A map of the form

Y1 = ψ1(X0,X1, ..., Xm)Y0 ...

Yn = ψn(X0,X1, ..., Xm)Y0,

Gi(X0,...,Xn) where the ψi = are ratios of homogeneous polynomials of equal degree in the Xj is referred to as a rational map. Hi(X0,...,Xn) In general, a rational map may be thought of as a function that transforms some set of points X in (X0...Xm) space to set of points Y in (Y0...Yn) space. Note that the denominators are polynomials and can have zeros. Thus the map may not be defined at all points. We denote this map by ψ : X Y . A rational map ψ : X Y is called birational→ if it admits an inverse. That is, there exists a rational map φ : Y X such that ψ(X) has the same dimension→ as Y , φ(Y ) has the same dimension as X, ψφ = 1 almost everywhere, and φψ =→ 1 almost everywhere. Two sets X and Y are said to be birational if there exists a birational map between X and Y . A classical theorem from algebraic geometry states that “Any algebraic variety Z(S) is birational with a hypersurface Z(h) of appropriate dimension” (see [100], Prop.I.4.9).

Definition 2.4. The degree of the algebraic variety Z(S) is then defined as the corresponding degree of the birationally equiv- alent hypersurface Z(h).

The construction of the hypersurface h for a given variety S can be done straightforwardly using multi-polynomial resul- tants. (Computationally, as we shall show in the next section, under certain assumptions on the variety, this can also be achieved using multi-polynomial remainder sequences). Given m independent equations in n variables (2.21), let S be the algebraic variety of dimension n m defined by these equations, i.e. Z(S) is the complete intersection of the m polynomial equations. We may construct a generic− linear projection onto n m + 1 of the variables. The image of this projection is the hypersurface − 44 CHAPTER 2. SETS, FUNCTIONS AND MAPPINGS

H in these n m + 1 variables. Determining, the dimension of an arbitrary variety is a non-trivial problem. However, various solutions have− been offered, for e.g., see [86, 133]. To find a generic linear projection, the following general procedure can be adopted. Consider the linear projective coordinate transformation

Y0 = a10X0 + a11X1 + ... + a1nXn ...

Yn = an0X0 + an1X1 + ... + annXn

The linear coordinate transformation transforms the original homogenized variety V : Z{Fi(X0, ..., Xn)} into, a bilinearly related variety Vˇ : Zˇ{Fˇi(Y0, ..., Yn)}, i = 1, ..., m (w.l.g.). Let R(Fˇ1, ..., Fˇm) = 0 be the irreducible resultant polynomial equation corresponding to the projection hypersurface H of the variety Vˇ . Irreducibility of H follows from the irreducibility of V and the projection mapping[100]. Let k be the multiplicity k k+1 of polynomial R (i.e. there exists a factor R1 such that R1 divides R but R1 does not). Then by applying ([78],Theorem 8.4.13), we see that the projection map is generically k to one. To make the map one-to-one we choose the coefficients of the linear projective transformation, aij, i, j = 0..n such that (i) the determinant of aij, is non zero (making the map well defined) ˇ ˇ and (ii) the discriminant of the polynomial R(f1, ..., fm) to be non zero. As “bad” values for aij which do not satisfy (i) and (ii) above, satisfy a set of hypersurface conditions, any random choice of values will in general suffice with probability 1, see [162].

Birational Map Computation The earlier section gave a way of constructing a hypersurface H as a one-to-one projection of the original algebraic variety V , or a bilinearly related variety Vˇ . We now show how such a one-to-one map can be inverted, yielding a birational map between H and V .

Theorem 2.5. Let X and Y be two irreducible n-dimensional varieties and ψ a rational map from X to Y that is generically one-to-one. Then under ψ, X and Y are birational.

This follows from ([100], Cor. I.4.5). Hence, since the map from V to H is one-to-one, there exists an inverse rational map from H to V . Such an inverse rational map from the irreducible polynomial R to the Ci’s may be recovered by using the Theorem of the Primitive Element ([190], section II.9). This construction for m = 2 is described in [3, 81]. A more general version for unrestricted m is described in [55, 24]. We now show that by using the Macaulay derivation of the multi-polynomial resultant, the construction of the inverse rational map reduces to applications of Cramer’s rule ([103], Thm. 6.9.2) in linear algebra. Recall the matrix equation (2.22) of section (2.7.2)

 d    X0 0  .   .      A  .  =  .  (2.26)      .   .  d Xm−1 0

d d Thus, the eliminated homogeneous variables = (X0 , ..., Xm−1) spans the kernel of A. To apply Cramer’s rule, we must first show that there exists a (N 1) by (N 1) minorX A that is non-singular. Since the birational map ψ is generically one-to-one, the order of vanishing of det−(A) must be− one. Since the order of vanishing of det(A) is one, the kernel of the matrix A must be one dimensional. Thus, the N 1 vectors A1 through AN−1 are linearly independent and therefore there must be an invertible − (N 1) by (N 1) minor of the matrix (A1, ..., AN−1). Removing a single row from the matrix (A1, ..., AN−1), we obtain an − − j th th invertible square matrix. Let Ai denote the i column of the matrix when the j row is deleted. Then using Cramer’s rule the X1 Xm−1 inverse rational map is constructed for each of the eliminated dehomogenized (affine) variables (x1 = , ..., xm−1 = ) X0 X0

j k Xl det(A1, ..., AN−1) xl = = k k X0 det(A1 , ..., AN−1) 2.7. ALGEBRAIC FUNCTIONS 45

jth monomial of vector X where the rows j and k are chosen such that xl = kth monomial of vector X , and 1 l (m 1). Using multi-polynomial resultant computations [48, 147], all calculations can be done in time single exponential≤ ≤ in m and− n. We now present an alternate method using the multi-polynomial remainder sequence of section (2.7.2) on the original affine polynomial system (2.21). We assume that the hypersurfaces fi = 0 1 i m intersect transversally. First, consider the ≤ ≤ subresultant polynomial remainder sequence (p.r.s) (2.23) : f1, f2, g = Sk−1,...,S1,S0. If the projection direction x1 is birational, and the hypersurfaces f1 = 0 and f2 = 0 have a transversal intersection, we show in [3] that

S1(x1, . . . , xn) = h1(x2, . . . , xn)x1

+h0(x2, . . . , xn) ˜ S0(x1, . . . , xn) = f(x2, . . . , xn)

That is, the last polynomial S0 is independent of x1, and is the resultant of f1 and f2 with respect to x1. More importantly the next-to-last polynomial S1 is linear in x1. It is referred to as the subresultant of f1 and f2 with respect to x1. The subresultant h0(x2,...,xn) equation S1 = 0 then provides the rational inverse map x1 = . h1(x2,...,xn) Similarly, computing the multi-polynomial remainder sequence (m.p.r.s) (2.25), under a birational projection direction x1, h0(x2,...,xn) yields after the first macro step, a reduced system (2.24) independent of x1 as well as the inverse map x1 = . After h1(x2,...,xn) the second macro step, under a birational projection direction x2, we obtain a reduced system independent of x2 as well as the h2(x3,...,xn) inverse map x2 = , and so on. Starting with m equations in (2.21), and after m 1 steps, with the elimination h3(x3,...,xn) − order of x1, x2, . . . , xm−1 one obtains the rational projection as well as the rational inverse map: ˜ f(xm, ..., xn) = 0

h2m−2(xm, . . . , xn) xm−1 = h2m−1(xm, . . . , xn) ... h2(x3, . . . , xn) x2 = h3(x3, . . . , xn) h0(x2, . . . , xn) x1 = (2.27) h1(x2, . . . , xn) .

Global polynomial and rational parameterization

A real implicit algebraic plane curve f(x, y) = 0 is a hypersurface of dimension 1 in R2, while a parametric plane curve 3 [f3(s)x f1(s) = 0, f3(s)y f2(s) = 0] is an algebraic variety of dimension 1 in R , defined by the two independent algebraic− equations in the three− variables x, y, s. Similarly, a real implicit algebraic surface f(x, y, z) = 0 is a hypersurface of 3 dimension two in R , while a parametric surface [f4(s, t)x f1(s, t) = 0, f4(s, t)y f2(s, t) = 0, f4(s, t)z f3(s, t) = 0] is − − − an algebraic variety of dimension 2 in R5, defined by three independent algebraic equations in the five variables x, y, z, s, t. A plane parametric curve is a very special algebraic variety of dimension 1 in x, y, s space, since the curve lies in the 2-dimensional subspace defined by x, y and furthermore points on the curve can be put in (1, 1) rational correspondence with points on the 1-dimensional sub-space defined by s. Parametric curves are thus a special subset of algebraic curves, and are often also called rational algebraic curves. Figure 2.5 depicts the relationship between the set of parametric curves and non-parametric curves at various degrees. Example parametric (rational algebraic) curves are degree two algebraic curves (conics) and degree three algebraic curves (cubics) with a singular point. The non-singular cubics are not rational and are also known as elliptic cubics. In general, a necessary and sufficient condition for the rationality of an algebraic curve of arbitrary degree is given by the Cayley-Riemann criterion: a curve is rational if and only if g = 0, where g, the genus of the curve is a measure of the deficiency of the curve’s singularities from its maximum allowable limit [176]. Algorithms for computing the genus of an algebraic curve and for symbolically deriving the parametric equations of genus 0 curves, are given for example in [6]. For implicit algebraic plane curves and surfaces defined by polynomials of degree d, the maximum number of intersections between the curve and a line in the plane or the surface and a line in space, is equal to the maximum number of roots of a polynomial of degree d. Hence, here the geometric degree is the same as the algebraic degree which is equal to d. For 46 CHAPTER 2. SETS, FUNCTIONS AND MAPPINGS

Degree Nine Parametrics Cubic Parametrics 9 9 Implicit Degree Nine Curves Implicit Degree Nine Surfaces

Degree Eight Parametrics Biquadratic Parametrics 8 8 Implicit Degree Eight Curves Implicit Degree Eight Surfaces G G E E O Separating O Separating Parametric & M Parametric and M E Non-parametric E Non-parametric T Curves T Surfaces R R I I C C Quartic Quadratic 4 4 Parametrics D Parametrics Implicit Quartics D E E Implicit Quartics G G R Cubic Implicit Cubics R E 3 Parametrics E 3 Cubics E E Implicit

2 2 Quadratic Implicit and Parametrics Implicit Quadrics

Implicit and Implicit and 1 Planar Parametrics 1 Planar Parametrics

Figure 2.5: A classification of low degree algebraic curves (left) and surfaces (right) 2.7. ALGEBRAIC FUNCTIONS 47 parametric curves defined by polynomials of degree d, the maximum number of intersections between the curve and a line in the plane is also equal to the maximum number of roots of a polynomial of degree d. Hence here again the geometric degree is the same as the algebraic degree. For parametric surfaces defined by polynomials of degree d the geometric degree can be as large as d2, the square of the algebraic degree d. This can be seen as follows. Consider the intersection of a generic line in space [a1x + b1y + c1z d1 = − 0, a2x + b2y + c2z d2 = 0] with the parametric surface. The intersection yields two implicit algebraic curves of degree d which intersect in O−(d2) points (via Bezout’s theorem), corresponding to the intersection points of the line and the parametric surface. (d−1)(d−2) 2 A parametric curve of algebraic degree d is an algebraic curve of genus 0 and so have 2 = O(d ) singular (double) points. This number is the maximum number of singular points an algebraic curve of degree d may have. From Bezout’s theorem, we realize that the intersection of two implicit surfaces of algebraic degree d can be a curve of geometric degree O(d2). Furthermore the same theorem implies that the intersection of two parametric surfaces of algebraic degree d (and geometric degree O(d2)) can be a curve of geometric degree O(d4). Hence, while the potential singularities of the space curve defined by the intersection of two implicit surfaces defined by polynomials of degree d can be as many as O(d4), the potential singularities of the space curve defined by the intersection of two parametric surfaces defined by polynomials of degree d can be as many as O(d8).

Parameterization of Curves

An irreducible algebraic curve Cd of degree d in the plane is one which is met by most lines in d points. Lines through a point P meet Cd (outside P ) in general at d multpCd points, where multpCd = e = multiplicity of Cd at P . If e = 1 then P is called a simple point. If e = 2 then− P is called a double point. Similarly we talk about an e-ple point or an e-fold point. If e = 0: P is not on Cd. If e > 1 we say P is a singular point of the curve Cd with multiplicity e. This also leads to the following theorem for curves

Theorem 2.6. [Bezout] Curves of degree d and curves of degree e, with no common components, meet at dcdote points, counting multiplicities and points at infinity. (Cd Ce = d e points.) · · Consider curve Cd of degree d to be also of order e.

X i j Cd : f(x, y) = aijx y = fd(x, y) + fd−1(x, y) + + fe(x, y) ··· e≤i+j≤d where fi(x, y) are homogeneous polynomials of degree i together with fd(x, y) = 0 and fe(x, y) = 0 so that d = degree and e 6 6 order. Thus fd(x, y) is the degree form and fe(x, y) is the initial or order form. Again, the multiplicity of a point P on Cd is geometrically, the number of points that a line through that point P meets Cd at P . By translation, we can assume the point P to be the origin. Then the equation of a line through the origin is y = mx. Its intersection with the curve is given by

f(x, mx) = fd(x, mx) + fd − 1(x, mx) + + fe(x, mx) d d − 1 ··· e = x fd(1, m) + x fd − 1(1, m) + x fe(1, mx) e d − e ··· = x [fd(1, m)x + + fe(1, m) ··· Lines through the origin meet the curve, outside the origin, in d e points. Hence the multiplicity of the origin = e = (order − of the curve). Thus if the curve Cd has a d 1 fold point (origin), then lines through that point meet F at one other point, and thereby parameterizes the curve (rational). − Here we can also note that for most values of m , fe(1, m) = 0. The values of m for which it is zero correspond to the Qe 6 fe(x, y) = (y mix) to the curve at the origin. (Tangents at P are thus those special lines which meet Cd at i=1 − P at more than e points, where e = multiplicity of Cd at P .) Now note for example that the equation of a conic has five independent coefficients and if we take five ‘independent’ points in the plane and consider a conic passing through these points then this will give five linear homogeneous equations in the five coefficient variables. If the rank of the matrix is 5 then there is a unique conic through these points. In general, the number of 1 independent coefficients of a plane algebraic curve Cd of degree d is 2 d(d + 3). One can easily prove by Bezout’s theorem that a curve of degree 4, for example, cannot have 4 double points. In general 1 1 one may see that the number of double points, say DP , of Cd is (d 1)(d 2). Assume DP > (d 1)(d 2). ≤ 2 − − 2 − − 48 CHAPTER 2. SETS, FUNCTIONS AND MAPPINGS

degree of curve 1 2 3 4 5 6 d the maximum number ··· 1 of double points 0 0 1 3 6 10 2 (d 1)(d 2) the number of inde- ··· − − pendent parameters 2 5 9 14 20 27 1 d(d + 3) ··· 2 Table 2.1: Relation of degree of curve to number of double points and independent parameters.

1 1 Then since (d 2)(d + 1) fixed points determine a Cd − 2 curve and if we choose (d 1)(d 2) + 1 double points 2 − 2 − − of Cd then to determine Cd − 2 one needs a remaining 1 1 (d 2)(d + 1) ( (d 1)(d 2) + 1) = (d 2) 1 = d 3 points. 2 − − 2 − − − − −

1 So take (d 3) other fixed simple points of Cd. Then we can pass a Cd − 2 curve through the above (d 1)(d 2) + 1 − 2 − − double points of Cd and (d 3) other simple points of Cd. Then counting the number of points of intersection of Cd and − Cd − 2 together with multiplicities yields

2 (d 1)(d 2) + 2 + d 3 = d 2d + 1 = (d 2)d + 1 = Cd Cd−2 + 1 − − − − − · which contradicts Bezout. Thus assuming Bezout we see that 1 DP (d 1)(d 2) ≤ 2 − − In general, we have Table 2.7.2

One definition of the genus g of a curve Cd is a measure of how much the curve is deficient from its maximum allowable limit of singularities, 1 g = (d 1)(d 2) 2 − − where DP is a ‘proper’ counting of the number of double points of Cd (summing over all singularities). From the earlier discussion and Bezout, we can see that in counting the number of double points DP of Cd an e-ple point of C is to be counted 1 as 2 e(e 1) double points. However− this counting is not very precise as such is the case only for the so called distinct multiple points of C. For a multiple point, that is not distinct, one has also to consider infinitely near singularities. In general a double point is roughly either a node or a . If a cusp is given by y2 x3 we call it a distinct cusp and is counted as a single double point. Cusps other than distinct look like y2 x2m + 1 (an m− fold cusp). Though the multiplicity of the origin is two (= order of the curve) the origin accounts for m−double points when− counted properly. The proper counting was achieved by Noether using homogeneous “Cremona quadratic transformations”, see also [176]. Following [2] we can achieve the same thing by using “affine quadratic transformations”. Consider for example, the cusp y2 x3 = 0 which has a double point at the origin. The quadratic transformation q given by − x =x ¯ and y =x ¯y¯ (2.28) yields 0 = y2 x3 =x ¯2y¯2 x¯3 =x ¯2(¯y2 x¯), − − − and canceling out the extraneous factor x¯2 we get the nonsingular parabola y¯2 x¯ = 0. So the origin in this case was a distinct singular point and counted as a single double point. − To desingularize the m fold cusp one has to make a succession of m transformations of the type (2.28). Only the mth successive application of (1)−changes the multiplicity of the origin from two to one. Hence in this case, counting properly, we say that the cusp has one distinct double point and (m 1) infinitely near double points, giving a total DP count of m. − 2.7. ALGEBRAIC FUNCTIONS 49

In a general procedure for counting double points, given an e-fold point P of a plane curve C, we choose our coordinates to bring P to the origin and then apply (2.28). If now C : f(x, y) = 0, then the substitution (2.28) transforms C into the curve C : f :(x, y) = 0 given by f(x, xy) = xef(x, y). Cbar will meet the line E :x ¯ = 0 in the points P 1,...,P m, the roots of f¯(0, y) = 0 which corresponds to the tangents to i 1 m C at P . If P is a ei-fold point of Cbar, then we shall have e1 + ... + em e. We say that P ,...,P are the points of i ≤ C¯ in the first neighborhood of P , and the multiplicity of C¯ at P is ei. Now iterate this procedure. The points of C infinitely near P can be diagrammed by the singularity tree of C at P . At every node of this tree (including the root) we keep a count equal to the multiplicity of C at that point which will then be the number of branches arising at that node. It follows that every node higher than a certain level will be unforked, that is have≥ a single branch. The desingularization theorem for algebraic plane curves, see [2] or [176] says that at every node higher than a certain level, the count equals one; in other words, C has only a finite number of singularities infinitely near P . Thus, since C has only finitely many distinct singularities, it follows that C has only a finite number of singular points, distinct as well as infinitely near. 1 Thus, by summing the counts of each node and counting 2 e(e 1) double points for a count e and additionally summing over all singularities of C and their corresponding singularity trees,− we obtain a precise count of the total number of double points DP of C. This proper counting of double points yields the following theorem.

Theorem 2.7. [Cayley-Reimann] g = 0 if and only if C has a rational parametrization.

In other words the given plane curve has its maximum allowable limit of singularities if and only if it is rational. Note also that in counting singularities we consider all the singularities of the projective curve. That is we consider the singularities at both finite distance as well as at infinity. The process of considering singularities at infinity is no different than that at finite distance. With regard to homogeneous coordinates let us consider Z = 0 to be the line at infinity. By swapping one of the axis lines x = 0 or y = 0 with the line at infinity we can bring the points at infinity to the affine plane. We illustrate this as well as Theorem 2 by means of an example. Consider again the m fold cusp y2 x2m + 1. We have seen earlier that the origin accounts for m double points when counted properly. Now consider− the singularity− at infinity. We swap the Z = 0 line with the Y = 0 line by homogenizing and then setting Y = 1 to dehemogenize.

Y 2Z2m − 1 X2m + 1 z2m − 1 x2m + 1 − ⇒ − 1 The singularity at infinity is again at the origin and of multiplicity 2m 1 accounting for 2 (2m 1)(2m 2) double points. On applying an appropriate quadratic transformation x = x and z =−xz, the multiplicity is reduced− to 2: −

z2m − 1 x2. − After a sequence of m 1 additional quadratic transformations the multiplicity at the origin finally reduces to one. These infinitely near singularities− then account for totally m 1 additional double points, resulting in a total DP count for the curve to be equal to − 1 1 m + (2m 1)(2m 2) + m 1 = (2m)(2m 1) 2 − − − 2 − which is exactly the maximum number of allowable double points for a curve of degree 2m + 1. Hence the m-fold cusp has genus 0 and is rational with a parametrization given by

x = t2, y = t2m + 1.

Parameterizing with lines The geometric idea of parameterizing a circle or a conic is to fix a point and take lines through that point which meet the conic at one additional point. Hence conics always have a rational parametrization, with the slope of the line being the single parameter. Next, consider a cubic curve, C3. A cubic curve is a curve to which most lines intersect in three points. If we consider a singular cubic curve then lines through the singular (double) point meet the curve at one additional point and hence rationally parameterize the cubic curve. If C3 has no singular points, then C3 cannot be parameterized by rational functions. 50 CHAPTER 2. SETS, FUNCTIONS AND MAPPINGS

Now intersecting a curve C with a pencil of lines through a fixed point P on it, can be achieved by sending the point P on C to infinity. To understand this, let us first consider an irreducible conic which is represented by the equation

g(x, y) = ax2 + by2 + cxy + dx + ey + f = 0

Bezout confirms that the irreducible conic cannot contain a double point for otherwise the conic consists of two lines. We observe that the trivial parameterizable cases are the parabola y2 = x which has no term in x2; the parabola x2 = y which has no term in y2; and the hyperbola xy = 1 which has no terms in x2 and y2. The non-trivial case arises when a and b are both non-zero, e.g. the ellipse. This then suggests that to obtain a rational parametrization all we need to do is to kill the y2 term. This can always be achieved by a suitable linear transformation resulting in the equation

(rx + s)y + (ux2 + vx + w) = 0 from which one can easily obtain a rational parametrization

(ut2 + vt + w) x = t, y = − (rt + s)

The elimination of the x2 or the y2 term through a coordinate transformation is said to make the conic irregular in x or y respectively. Geometrically speaking, a conic being irregular in x or y means that most lines parallel to the x or y axis respectively, intersect the conic in one point. Note that most lines through a fixed point on the conic meet the conic in one additional varying point. By sending the fixed point to infinity we make all these lines parallel to some axis and the curve irregular in one of the variables (x, or y) and hence amenable to parametrization. The coordinate transformation we select is thus one which sends any point on the conic to infinity along either of the coordinate axis x or y. As an example consider the unit circle and fix a simple point P ( 1, 0) on it: (x, y) affine coordinates ( 1, 0) and (X,Y,Z) homogeneous coordinates ( 1, 0, 1). Send P to a point at− infinity along the y-axis. That is, send ( −1, 0, 1) to (0, 1, 0). (Explanation: A point on y-axis− is like (0, p, 1) divide by p and let p ). Thus we achieve by a homogeneous− linear transformation which transforms ( 1, 0, 1) to (0, 1, 0) → ∞ − X αX + βY + γZ → Y αˆX + βˆY +γ ˆZ → Z α∗X + β∗Y + γ∗Z → The chosen point on the circle ( 1, 0, 1) determines − 1 = β, 0 = β,ˆ 1 = β∗ − and the α’s and γ’s are chosen such that the det ( α’s , β’s, γs) ! = 0, yielding a well defined invertible transformation. So let us take as our homogeneous linear transformation

X Y, → − Y Z, → Z X + Y. → We first homogenize the circle x2 + y2 1 = 0 to X2 + Y 2 Z2 = 0. On applying the above linear transformation we 2 − − eliminate the Y term 2 2 Y + Z (X + Y )2 = 0 − 2 2 2 2 Z X 2XY = X Z Y = − . ⇒ − − ⇒ 2X Then on dehomogenizing by setting Z = 1 and using the linear transformation to obtain the original affine coordinates and setting X = t, we obtain the rational parametrization of the circle:

X Y Y 1 x = = − , y = = Z X + Y Z X + Y 2.7. ALGEBRAIC FUNCTIONS 51

 ( −(1 − t2)/2t 1 − t2 X = t x = t + (1 − t2)/2t = 1 + t2 1 − t2 1 − 2t Y = 2t ⇒ y = t + (1 − t2)/2t = 1 + t2 In general, curves of degree d with a distinct d 1 fold point can be rationally parameterized by sending the d 1 fold − − point to infinity. Consider f(x, y) a polynomial of degree d in x and y representing a plane algebraic curve Cd of degree d with a distinct d 1 fold singularity. − Note that singularities of a plane curve can be computed by simultaneously solving the equations f = fx = fy = 0 where fx and fy are the x and y partial derivatives of f, respectively. One way of obtaining the common solutions is to find those roots of Resx(fx, fy) = 0 which are also the roots of f = 0. Here Resx(fx, fy) is the resultant of fx and fy treating them as polynomials in x. Note singularities at infinity can be obtained the same way after replacing the line at infinity with one of the coordinate axes. In particular on homogenizing a plane curve f(x, y) to F (X,Y,Z) we can set Y = 1 to obtain fbar(x, z) thereby swapping the line at infinity Z = 0 with the line Y = 0. Now the above procedure can be applied to fbar(x, z) to find the singularities at infinity. Let us then compute the d 1 fold singularity of the curve Cd and translate it to the origin by a simple linear transformation. Then the polynomial describing− the curve will be of the form

f(x, y) = fd(x, y) + fd−1(x, y) where fd, (degree form), consists of the terms of degree d and fd−1 consists of terms of degree d 1. On homogenizing this curve we obtain −

d d−1 d d−1 d−2 d−1 F (X,Y,Z) = a0Y + a1Y X + ... + adX + b0Y Z + b1Y XZ + ... + bdX Z Now by sending the singular point (0, 0, 1) to infinity along the Y axis we can eliminate the Y d term. This as before by a homogeneous linear transformation which maps the point (0, 0, 1) to the point (0, 1, 0) and given by

X = XY = Z,Z = Y which yields

d d−1 d d−1 d−2 d−1 F (X, Y, Z) = a0Z + a1Z X + + adX + b0Z Y + b1Z XY + + bdX Y, ··· ··· d d−1 d a0Z + a1Z X + + adX Y = d−1 d−2 ··· d−1 . −b0Z + b1Z X + ... + bdX Then dehomogenizing, by setting Z = 1 and using the linear transformation to obtain the original affine coordinates

X X Y Z x = = , y = = Z Y Z Y and setting X = t we obtain the rational parametrization of the curve. Alternatively we could have symbolically intersected a single parameter family (pencil) of lines through the d 1 fold − singularity with Cd and obtained a rational parameterization with respect to this parameter. This concept of passing a pencil of curves through singularities is generalized in the next section.

Parameterizations of Real Cubic Surfaces Low degree real algebraic surfaces (quadrics, cubics and quartics) play a significant role in constructing accurate computer models of physical objects and environments for purposes of simulation and prototyping[19]. While quadrics such as , cones, hyperboloids and paraboloids prove sufficient for constructing restricted classes of models, cubic algebraic surface patches are sufficient to model the boundary of objects with arbitrary topology in a C1 piecewise smooth manner [23]. Real cubic algebraic surfaces are the real zeros of a polynomial equation f(x, y, z) = 0 of degree three. In this representa- tion the cubic surface is said to be in implicit form. The irreducible cubic surface which is not a cylinder of a nonsingular cubic curve, can alternatively be described explicitly by rational functions of parameters u and v: f (u, v) f (u, v) f (u, v) x = 1 , y = 2 , z = 3 , (2.29) f4(u, v) f4(u, v) f4(u, v) 52 CHAPTER 2. SETS, FUNCTIONS AND MAPPINGS

where fi, i = 1 ... 4 are polynomials. In this case the cubic surface is said to be in rational parametric form. Real cubic algebraic surfaces thus possess dual implicit-parametric representations and this property proves important for the efficiency of a number of geometric modeling and computer graphics display operations [19, 124]. For example, with dual available representations the intersection of two surfaces or surface patches reduces simply to the sampling of an algebraic curve in the planar parameter domain [15]. Similarly, point-surface patch incidence classification, a prerequisite for boolean set operations and ray casting for graphics display, is greatly simplified in the case when both the implicit and parametric representations are available [15]. Additional examples in the computer graphics domain which benefit from dual implicit- parametric representations are the rapid triangulation for curved surface display and image texture mapping on curved surface patches. Deriving the rational parametric form from the implicit representation of algebraic surfaces, is a process known as rational parameterization. Algorithms for the rational parameterization of cubic algebraic surfaces have been given in [5, 165], based on the classical theory of skew straight lines and rational curves on the cubic surface [39, 101]. One of the main results of our current paper is to constructively address the parameterization of cubic surfaces based on the reality of the straight lines on the real cubic surface. In doing so we provide an algorithm to construct all twenty-seven straight lines (real and complex) on the real nonsingular cubic surface. We prove that the parameterizations of the real cubic surface components are constructed using a pair of real skew lines for those three families which have them, and remarkably using a complex conjugate pair of skew lines, in a fourth family. There does not appear to be a similar rational parameterization for the fifth family that covers all or almost all of the surface, so instead we use two disjoint parameterizations which involve one square root each. A rational parameterization that covers part of the surface is described in [165]. In that scheme points which lie on planes through points on a real line are covered, but these points do not necessarily comprise most of the surface, and the covering is in general two-to-one instead of one-to-one. All of the parameterizations described are one-to-one, meaning that for any point on the cubic surface there can be just one set of values (u, v) which give rise to that point. We also analyze the image of the derived rational parameterization for both real and complex parameter values, together with “base” points where the parameterizations are ill-defined. These base points cause a finite number (at most five) of lines and points, and possibly two conic sections lying on the surface, to be missed by the parameterizations. One of these conics can be attained by letting u and the other with v separately, or by using projective coordinates u, u∗ and v, v∗ instead of (u, v) and setting→ ±∞v = 0 and u = 0, respectively.→ ±∞ { } { } One of the gems of classical algebraic geometry has been the theorem that twenty-seven distinct straight lines lie completely on a nonsingular cubic surface [154]. Schla¨fi’s double-six notation elegantly captures the complicated and many-fold symmetry of the configurations of the twenty-seven lines. He also partitions all nonsingular cubic surfaces f(x, y, z) = 0 into five families F1,...,F5 based on the reality of the twenty-seven lines. Family F1 contains 27 real straight lines, family F2 contains 15 real lines, and family F3 contains 7 real lines while families F4 and F5 contain 3 real lines each. What distinguishes F4 from F5 is that while 6 of the 12 conjugate complex line pairs of F4 are skew (and 6 pairs are coplanar), each of the 12 conjugate pairs of complex line pairs of F5 is coplanar. When a nonsingular cubic surface F tends to a singular cubic surface G (with an isolated double point or a double line) 12 of F ’s straight lines (constituting a double six) tend to 6 lines through a double point of G. Hence singular cubic surfaces have only twenty-one distinct straight lines. Alternatively a classification of cubic surfaces can be obtained from computing all ‘base’ points of its parametric represen- tation, f (u, v) f (u, v) f (u, v) x = 1 , y = 2 , z = 3 , f4(u, v) f4(u, v) f4(u, v)

Base points of a surface parameterization are those isolated parameter values which simultaneously satisfy f1 = f2 = f3 = f4 = 0. It is known that any nonsingular cubic surface can be expressed as a rational parametric cubic with six base points. The classification of nonsingular real cubic surfaces then follows from:

1. If all six base points are real, then all 27 lines are real, i.e. the F1 case.

2. If two of the base points are a complex conjugate pair then 15 of the straight lines are real, i.e. the F2 case.

3. If four of the base points are two complex conjugate pairs then 7 of the straight lines are real, i.e. the F3 case.

4. If all base points are complex then three of the straight lines are real. In this case the three real lines are all coplanar, i.e. the F4 and F5 cases. 2.7. ALGEBRAIC FUNCTIONS 53

Real and Rational Points on Cubic Surfaces

The Clebsch Diagonal Cubic The Cayley Cubic The Ding-Dong Surface

81x3 + 81y3 + 81z3 189x2y 189x2z 5x2y 5x2z 5y2x 5y2z x2 + y2 (1 z)z2 189y2x 189y2z − 189z2x − 189z2y −5z2y −5z2x +− 2xy + 2−xz + 2yz− − − +54− xyz +− 126xy +− 126xz +− 126yz − 9x2, 9y2 9z2 9x 9y 9z + 1 − − − − − − (27 real lines with 10 triple points) (9 real lines = 6 connecting 4 double points, and 3 in a copla- nar config) We first begin by computing a simple real point (with a predefined bit precision) on a given real cubic surface f(x, y, z) = 0. For obvious reasons of exact calculations with bounded precision it is very desirable to choose the simple point to have rational coordinates. Mordell in his 1969 book [134] mentions that no method is known for determining whether rational points exist on a general cubic surface f(x, y, z) = 0, or finding all of them if any exist. We are unaware if a general criterion or method now exists or whether Mordell’s conjecture below has been resolved. The following theorems and conjecture exhibit the difficulty of this problem, and are repeated here for information. Theorem[[134],chap 11]: All rational points on a cubic surface can be found if it contains two lines whose equations are defined by conjugate numbers of a quadratic field and in particular by rational numbers. Theorem[[134],chap 11]: The general cubic equation (irreducible cubic and not a function of two independent variables nor a homogeneous polynomial in linear functions of its variables) has either none or an infinity of rational solutions. Mordell Conjecture[[134],chap 11]: The cubic equation F (X,Y,Z,W ) = 0 is solvable if and only if the congruence F (X,Y,Z,W ) 0 (mod pr) is solvable for all primes p and integers r > 0 with (X, Y, Z, W, p) = 1. ≡ We present a straightforward search procedure to determine a real point on f(x, y, z) = 0, and if lucky one with rational coordinates. Collect the highest degree terms of f(x, y, z) and call this homogeneous form F3(x, y, z). Recursively determine if F3(x, y, z) = 0 has a rational point. Being homogeneous, one only needs to check for F3(x, y, 1) = 0 and F3(x, y, 0) = 0, which are both polynomials in one less variable, and hence the recursion is in dimension. Now for a univariate polynomial equation g(x) = 0 we use the technique of [125] to determine the existence and coordinates of a rational root. If not, one computes a real root having the desired bit precision as explained below. Additionally, if the highest degree terms of f(x, y, z) do not yield a rational point, we compute the resultant and linear subresultants of f and fx, eliminating x to yield new polynomials f1(y, z) and xf2(y, z) + f3(x, y, z) (see [16] for details of this computation). Recursively compute the rational points of f1(y, z) = 0, using the equation xf2(y, z) + f3(x, y, z) = 0 to determine the rational x coordinate given rational y and z coordinates of the point. In the general case, therefore, we are forced to take a real simple point on the cubic surface. We can bound the required precision of this real simple point so that the translations and resultant computations in the straight line extraction and cubic surface parameterization algorithm of the next section, are performed correctly. The lower bound of this value can be estimated as in [46] by use of the following gap theorem: Gap Theorem ([46],p70). Let (d, c) be the class of integral polynomials of degree d and maximum coefficient magnitude P c. Let fi(x1, , xn) (d, c), i = 1, , n be a collection of n polynomials in n variables which has only finitely many ··· ∈ P ··· −ndn solutions when homogenized. If (α1, , αn) is a solution of the system, then for any j either αj = 0, or αj > (3dc) . ··· | | 54 CHAPTER 2. SETS, FUNCTIONS AND MAPPINGS

Weierstrass Factorization

Consider f(x, y) with degree d and ordy f(0, y) = e < . The ordy f(0, y) is the y-exponent of the lowest de- gree term in f(0, y) and is equal to if f(0, y) = 0. The occurrence∞ of f(0, y) = 0 can be rectified by a simple lin- ear transformation (rotation) of f(x,∞ y), which avoids making the x-axis, a tangent to the curve f(0, y) = 0 at the ori- gin, and hence yields a nonzero f(0, y) and a finite ordy f(0, y). A Weierstrass power series factorization is of the form e e−1 f(x, y) = g(x, y)(y + ae−1(x)y + + a0(x)) where g(x, y) is a unit power series, i.e., g(0, 0) = 0 while h(x, y) | {z ··· } 6 h(x,y) is a “distinguished” polynomial in y with coefficients ai(x), i = 0 . . . e 1 being non-unit power series, i.e., ai(0) = 0. The Weierstrass preparation can efficiently be achieved via Hensel Lifting.− Given

k f(x, y) = f0(y) + f1(y)x + + fk(y)x + ··· ··· with e f(0, y) = f0(y) = (a0 + a1y + ) y , a0 = 0 | {z ···} |{z} 6 g0(y) h0(y) in general for k 1, we wish to compute hk(y) and gk(y) using Hensel, yielding factors similar to (2.31) such that ≥ X e fk(y) gi(y)hj(y) = g0(y)hk(y) + y gk(y) (2.30) − i>0, j>0, i+j=k with degree hk(y) < e. P fk(y) − i>0, j>0, i+j=k gi(y)hj (y) To achieve this we compute A(y) = and then set hk(y) = terms of A(y) with degree g0(y) < e and gk(y) = terms of A(y) with degree e. ≥ Hensel Lifting Consider f(x, y) of degree d. Assume it is monic in y .

k f(x, y) = f0(y) + f1(y)x + + fk(y)x + ··· ··· We wish to compute real power series factors g(x, y) and h(x, y) where f(x, y) = g(x, y)h(x, y). The technique of Hensel lifting allows one to reconstruct the power series factors

i g(x, y) = g0(y) + g1(y)x + + gi(y)x + ··· j ··· h(x, y) = h0(y) + h1(y)x + + hj(y)x + (2.31) ··· ··· from initial factors f(0, y) = f0(y) = g0(y)h0(y). Consider the factorization of f(0, y) = f0(y) as the base case of k = 0. Assume f0(y) is of degree d. Choose real coprime factors g0(y) of degree p and h0(y) of degree q satisfying: p + q = d. Real coprimeness is achieved by ensuring that g0 and h0 contain distinct real roots of f0 and that complex conjugate pairs are not split up. However, it may arise that the only coprime factors of f0 are complex, that is, the distinct roots are complex conjugates, in which case the curve f(x, y) = 0 does not intersect the y-axis and there is no real Newton power series factorization. Since GCD(g0(y), h0(y)) = 1 using the fast GCD algorithm we can also compute α(y) and β(y) such that α(y)g0(y) + β(y)h0(y) = 1. In the iterative Case of k 1, we compute gk(y) and hk(y) of the desired factorization (2.31), with degree of gk(y) < p ≥ and degree of hk(y) < q, as follows. We note from (2.31) that X fk(y) = gi(y)hj(y) i + j = k and additionally

X ∗ ∗ fk(y) gi(y)hj(y) = g0(y)h (y) + h0(y)g (y) (2.32) − k k i>0, j>0, i+j=k 2.7. ALGEBRAIC FUNCTIONS 55

Hence,

∗ X h (y) = α(y)[fk(y) gi(y)hj(y)] k − i>0, j>0, i+j=k ∗ X g (y) = β(y)[fk(y) gi(y)hj(y)] k − i>0, j>0, i+j=k

∗ ∗ ∗ ∗ If degree h (y) q then compute hk(y) = h (y) mod h0(y) and set gk(y) = γ(y)g0(y) + g (y) where h (y) = γ(y)h0(y) + hk(y). k ≥ k k k X fk(y) gi(y)hj(y) = g0(y)hk(y) + h0(y)gk(y) (2.33) − i>0, j>0, i+j=k

Clearly degree hk(y) is < q. Additionally in (2.33) the degree of gk(y) must also be < p. This is so because in (2.33) the degree of the LHS is < d and since degree g0(y)hk(y) is < d and degree h0(y) is = q, it must be that degree gk(y) is < p.

Local Parametrization Piecewise polynomials of fixed degree and continuously differentiable up to some order are known as splines or finite elements. Splines are used in applications ranging from computer-aided design, computer graphics, data visualization, geometric model- ing, and image processing to the solution of partial differential equations via finite element analysis. The spline-fitting problem of constructing a mesh of finite elements that interpolate or approximate multivariate data is by far the primary research problem in geometric modeling. Parametric splines are vectors of a set of multivariate polynomial (or rational) functions while implicit splines are zero contours of collections of multivariate polynomials. The various spline methods may be distinguished by several criteria: Implicit or parametric representations. • Algebraic and geometric degree of the spline basis. • Number of surface patches required. • Computation (time) and memory (space) required. • Stability of fitting algorithms. • Local or nonlocal interpolation. • Splitting or nonsplitting of input mesh. • Convexity or nonconvexity of the input and solution. • Fairness of the solution (first- and second-order variation). • Plane Curves

Computation of Topology Given a real algebraic plane curve C: f(x, y) = 0 of degree d and of arbitrary genus, a box B defined by (x, y) α x β, γ y δ , an error bound  > 0, and integers m, n with m + n d construct a C−1, { | ≤ ≤ ≤ ≤ } ≤ C0 or C1 continuous piecewise rational -approximation of all portions of C within the given bounding box B, with each Pi −1 rational function of degree Pi m and degree Qi n. Here C means no continuity condition is imposed between the Qi ≤ ≤ different pieces, C0 implies there are no gaps and C1 implies that the first derivatives are continuous at the common end points of adjacent pieces. The -approximation here means that the approximation error is within given . The input curve f(x, y) = 0 may be reducible and have several real components but we assume it has components of only single multiplicity i.e. polynomial f(x, y) has no repeated factors. We use a combination of both algebraic and numerical techniques to construct a C1-continuous, piecewise (m, n) rational - approximation by two different approaches, of a real algebraic plane curve. At singular points we rely on the classical resolution of plane curves [4, 176] based on the Weierstrass Preparation Theorem [180] and Newton power series factorizations[138], using the technique of Hensel lifting[102]. These, together with modified Padé approximations [142], are used to efficiently 56 CHAPTER 2. SETS, FUNCTIONS AND MAPPINGS

Figure 2.6: (x2 + y2)3 4x2y2 = 0 − construct locally approximate, rational parametric representations for all real branches of an algebraic plane curve. Besides singular points we obtain an adaptive selection of simple points about which the curve approximations yield a small number of pieces yet achieve C1 continuity between pieces. The simpler cases of C−1 and C0 continuity are also handled in a similar manner. Details of the implementation of all these algorithms in GANITH [34] are also provided.

Hermite Interpolation using Real Algebraic Surfaces The Problem: Construct a real algebraic surface S, which smoothly 3 interpolates a collection of k points pi in R with associated fixed “normal” unit vectors mi, and l given space curves Cj 3 in R also with associated “normal” unit vectors nj, varying along the entire span of the curves, (i = 1 . . . k, j = 1 . . . l). Both points and space curves have an infinity of potential “normal” vector directions. While for points the mi may be chosen arbitrarily, for space curves Cj, the varying unit vectors nj are chosen to be always orthogonal to the tangent vector tj, that is, tj nj = 0, along the entire curve. Our emphasis being algebraic space curves, the variance of the curves “normals” are · restricted to univariate polynomials of some degree. Also, we assume that any of the vectors mi and nj are never identically zero, a phenomenon that occurs at point and curve singularities. By smoothly interpolates we shall mean that S contains each of the points and curves and furthermore has its gradient in the same direction as the “normal” vectors mi and nj. This is a natural generalization of Hermite interpolation, applied to fitting curves through point data, and equating derivatives at those points. As we shall see later, the choice of the associated “normal” direction, in each case is dictated by the use of the Hermite interpolated surface, (eg, in “blending” or “joining” or “fleshing”). Related Work: Sarraga in [159] presents techniques for constructing a C1-continuous surface of rectangular Bézier (parametric) surface patches, interpolating a net of cubic Bézier curves. Other approaches to parametric surface fitting and transfinite interpolation are also mentioned in that paper, as well as in [183]. An excellent exposition of exact and least squares fitting of algebraic surfaces through given data points, is presented in [144]. Meshing of given algebraic surface patches using control techniques of joining Bézier polyhedrons is shown in [163]. Surface blending consisting of “rounding” and “filleting” surfaces (smoothing the intersection of two primary surfaces), a special case of Hermite interpolation, has been considered for polyhedral models in [75] and for algebraic surfaces in [108, 107, 131, 141, 152, 178, 179, 183]. Results: We show in Sections 3, 4 and 5 that the problem of generalized Hermite interpolation of points and curves with algebraic surfaces, reduces to solving systems of linear equations, albeit at times with symbolic coefficients. In particular for an algebraic surface of degree n, to smoothly contain k points and l space curves of degree d with assigned “normal” directions, varying as a polynomial of degree m, the number of linear equations to be satisfied is 3k + (2n + m 1)dl + 2l. This number − 2.7. ALGEBRAIC FUNCTIONS 57

Figure 2.7: x4 + y4 + z = 0 and y2 + z = 0 58 CHAPTER 2. SETS, FUNCTIONS AND MAPPINGS reduces to 3k +(2n 1)dl +ml +2l when all the space curves and “normals” are represented parametrically. Since the number − n+3 of independent coefficients (unknowns) of a general algebraic surface of degree n is 3 1, the number of linear equations stated above, yields both necessary and sufficiency conditions on Hermite interpolated algebraic− surfaces, for a variety of point and curve data configurations. As applications of this simple vector space characterization of Hermite interpolated algebraic surfaces, we show, in section 5., for example, that:

Two space lines with constant-direction normals can be Hermite interpolated with a real quadric if and only if the lines • are parallel or intersect at a point, and the normals are not orthogonal to the plane containing them. The real quadric is a “cylinder” when the lines are parallel and a “cone” when the lines intersect.

Two skewed lines with constant-direction normals cannot be Hermite interpolated with real quadrics. The only real • quadratic surface which satisfies both containment and tangency conditions reduces into two planes.

The minimum degree of a real algebraic surface, which Hermite interpolates two lines in space, one with a constant • direction normal, the other with a linearly varying normal is three.

Two lines with linearly varying normals can be Hermite interplated by a quadric in only some special cases. In general, • a surface of at least degree three is needed. When real quadric surface interpolation is possible, the real quadric is either a hyperboloid of one sheet (the two lines may be parallel, intersecting, or skewed) or a hyperbolic paraboloid (the two lines can only be intersecting or skewed).

Lines in space with constant-direction normals, occur naturally as edges of polyhedra, with the Hermite interpolating surfaces being used to “smooth” planar faces containing those edges. Lines with linearly-varying normals occur on real quadric and cubic surfaces. Similar results to the ones above, are also derived in sections5. and 6., for Hermite interpolation of conics and cubics in space. Since these rational curves lie on quadrics, cubic surfaces and higher degree algebraic surfaces, our method gives a powerful way of automatically, generating low degree “blending” and “joining” and “fleshing” surfaces with tangent continuity at intersections.

Preliminaries For any multivariate polynomial f, partial derivatives are written by subscripting, for example, fx = ∂f/∂x, 2 fxy = ∂ f/(∂x∂y), and so on. Since we consider algebraic curves and surfaces, we have fxy = fyx etc. Vectors and vector functions are denoted by bold letters. The inner product of vectors a and b is denoted a b. The length of the vector a is a = √a a. · k k · The gradient of f(x, y, z) is the vector f = (fx, fy, fz). A point p = (x0, y0, z0) is a simple point of f if the gradient of f at p is not null; otherwise the point is singular∇ . An algebraic surface is non-singular or smooth if all its points are simple.

3 Definition 2.8. Let p = (a, b, c) be a point with an associated “normal” m = (mx, my, mz) in R . An algebraic surface S : f(x, y, z) = 0 is said to smoothly contain p if (1) f(p) = f(a, b, c) = 0, (containment condition) and (2) f(p) is not zero and f(p) = αm, for some nonzero α. (tangency condition) ∇ ∇

Definition 2.9. Let C be an algebraic space curve with an associated varying “normal” n(x, y, z) = (nx(x, y, z), ny(x, y, z), nz(x, y, z)), defined for all points on C. An algebraic surface S : f(x, y, z) = 0 is said to smoothly contain C if (1) f(p) = 0 for all points p of C. (containment condition) and (2) f(p) is not identically zero and f(p) = αn(p), for some nonzero α and for all points p of C. (tangency condition) ∇ ∇ Definition 2.10. An algebraic surface S : f(x, y, z) = 0 is said to Hermite interpolate a given collection of data points with associated “normals”, and data curves with associated “normals”, if S smoothly contains all the data points and curves.

The following is one form of Bezout’s theorem (the oldest theorem of algebraic geometry).

Theorem 2.11. An algebraic curve C of degree d intersects an algebraic surface S of degree n in at most nd points, or else it must intersect it infinitely often, that is, a component of C must lie entirely on S. 2.7. ALGEBRAIC FUNCTIONS 59

Higher Order Interpolation for Implicit Data In the Hermite interpolation, smoothness is achieved by forcing normals of tangent planes of a surface to be parallel to those of given points and space curves. For some applications of geometric modeling, for example, design of ship hulls, however, more than tangent-plane continuity is desirable. The concept of smoothness is generalized by defining a higher order geometric continuity. DeRose [61] gives such a definition between parametric surfaces, k where two surfaces F1 and F2 meet with order k geometric continuity, concisely stated as C continuity along a curve C if 0 0 0 and only if there exist local reparameterizations F1 and F2 of F1 and F2, respectively, such that all partial derivatives of F1 and 0 k F2 up to order k agree along C. Warren [178] formulates an intuitive definition of C continuity between implicit surfaces as follows :

Definition 2.12. Two algebraic surfaces f(x, y, z) = 0 and g(x, y, z) = 0 meet with Ck rescaling continuity at a point p or along an irreducible algebraic curve C if and only if there exists two polynomials a(x, y, z) and b(x, y, z), not identically zero at p or along C, such that all derivatives of af bg up to order k vanish at p or along C. − This formulation is more general than just making all the partials of f(x, y, z) = 0 and g(x, y, z) = 0 agree at a point or along a curve. For example, consider the intersection of the cone f(x, y, z) = xy (x + y z)2 = 0 and the plane g(x, y, z) = x = 0 along the line defined by two planes x = 0 and y = z. It is not− hard to see− that these two surfaces meet smoothly along the line since the normals to f(x, y, z) = 0 at each point on the line are scalar multiples of those to g(x, y, z) = 0. But, this scale factor is a function of z. Situations like these are corrected by allowing multiplication by certain polynomials, not identically zero along a intersection curve. Note that multiplication of a surface by polynomials nonzero along a curve does not change the geometry of the surface in the neighborhood of the curve. Garrity and Warren [82] also prove that this notion of rescaling Ck continuity is equivalent to other order k derivative continuity measures as well as to reparameterization continuity for parametric surfaces. In [27], it is shown that, given a surface degree, the Hermite interpolation algorithm finds all surfaces meeting each other with C1 continuity. Though we are currently unable to translate geometric specifications for Ck continuity (k 2) into a k ≥ matrix MI whose nullspace captures all C continuous surfaces of a fixed degree, we can generate an interpolation matrix MI whose nullspace captures an interesting proper subset of the whole class. This technique is based on the following theorem.

Theorem 2.13. Let g(x, y, z) and h(x, y, z) be distinct, irreducible polynomials. If the surfaces g(x, y, z) = 0 and h(x, y, z) = 0 intersect transversally in a single irreducible curve C, then any algebraic surface f(x, y, z) = 0 that meets g(x, y, z) = 0 with Ck rescaling continuity along C must be of the form f(x, y, z) = α(x, y, z)g(x, y, z)+β(x, y, z)hk+1(x, y, z). If g(x, y, z) = 0 and h(x, y, z) = 0 share no common components at infinity, then the degree of α(x, y, z)g(x, y, z) degree of f(x, y, z) and the degree of β(x, y, z)hk+1(x, y, z) degree of f(x, y, z). ≤ ≤ Proof: If g = 0 and h = 0 intersect transversally in a single irreducible curve, then [121, Ch. VI] and [178, Ch. III] show that the space of all surfaces interpolating (g = 0) (h = 0) consists of exactly those surfaces that can be expressed as cg + gh = 0 where c and d are polynomials in x, y, and∩ z. Algebraically, this condition corresponds to the fact the the polynomials g and h generate a prime ideal (see [178] for more details). Macaulay [127, pp. 52] shows that this algebraic condition implies that any polynomial p, all of whose up to order k vanish along (g = 0) (h = 0), must be Pk+1 i k+1−i ∩ expressible in the form p = i=0 γig h where the γi are polynomials in x,y, and z. By the definition of Ck rescaling continuity, there must must exist a(x, y, z) and b(x, y, z) (not identically zero on (g = 0) (h = 0)) such that all partial derivatives of af bg up to order k vanish on (g = 0) (h = 0). Thus, af bg = Pk∩+1 i k+1−i − k+1 ∩ − i=0 βig h . This expression can be rewritten as af = eg + fh . Finally, since a(x, y, z) is nonzero on (g = 0) (hk+1−i = 0) and it is possible to show [178, pp. 15] that f by itself can be expressed in the form αg + βhk+1. ∩ The second portion of the theorem follow directly from the fact that g = 0 and h = 0 do not have any common components at infinity. A proof of this fact apppears in [178, Ch. V]. For given curves Ci, i = 1, , l which are, respectively, the transversal intersection of given surfaces gi(x, y, z) = 0 and ··· k hi(x, y, z) = 0, a surface f(x, y, z) = 0 containing space curves Ci with C continuity can be constructively obtained by the relations

k+1 f(x, y, z) = αi(x, y, z)gi(x, y, z) + βi(x, y, z)h (x, y, z), i = 1, , l. (2.34) i ···

Since the gi and hi are known surfaces, the unknown coefficients are those of f, αi and βi. When the hypothesis of Theo- rem 2.13 is met, the polynomials αi and βi are of bounded degrees. From the relations in (2.34), we see that these unknown coefficients form a system of linear equations, yielding an interpolation matrix MI. 60 CHAPTER 2. SETS, FUNCTIONS AND MAPPINGS

Figure 2.8: A C2 Continuous Algebraic Surface

Figure 2.9: C3 Continuous Algebraic Surfaces 2.7. ALGEBRAIC FUNCTIONS 61

Higher Order Interpolation for Parametric Data There exists extensive literature on parametric curves and surfaces and their use in computer aided geometric design, see [61] for several references. Parametric surfaces have been successfully used in creating three dimensional objects, and it is quite natural to have higher order geometric information available in the parametric form. That is, geometric input information could be given in terms of a parametric surface in x, y, z space, H(s, t) = (x(s, t), y(s, t), z(s, t)), where x(s, t), y(s, t), and z(s, t) are rational polynomials in s and t, and a parametric curve described by C(u) = (s(u), t(u)) in the s, t parameter space. An algebraic surface f(x, y, z) = 0 that meets H(s, t) along H(C(u)) with Ck continuity can again be selected from the nullspace of a properly computed matrix. As discussed in Garrity and Warren [82], f(x, y, z) = 0 meets H(s, t) at a smooth k point p0 = H(C(u0)) with C continuity if and only if f(H(s, t)) and all the partial derivatives of f(H(s, t)) up to order k are zero at C(u0). Knowing this one can easily see that an algebraic surface f(x, y, z) = 0 meets a parametric surface H(s, t) along the entire curve H(C(u)) if and only if f(H(C(u))) and all the partial derivatives of f(H(C(u))) up to order k are zero for all values of u.

Example 2.14. (COMPUTATION OF C2 CONTINUOUS BLOBS) 1+2s+s2+t2 2t 1−s2−t2 Consider two circles on two spheres H1(s, t) = (x = 1+s2+t2 , y = 1+s2+t2 , z = 1+s2+t2 ) and H2(s, t) = (x = −1+2s−s2−t2 2t 1−s2−t2 1+s2+t2 , y = 1+s2+t2 , z = 1+s2+t2 ), that are defined by C1(u) = C2(u) = (s = 0, t = u) in the parameter space. A generic quartic algebraic surface f(x, y, z) = 0 has 35 unknown coefficients, and making f(Hi(s, t)) and all of its partial derivatives up to order two vanish along Ci(u) produces 88 homogeneous linear equation in terms of the 35 unknowns. The rank of this homogeneous linear system turns out to be 32, and the surface contains three free parameters in its coefficients : 2 4 2 2 2 f(x, y, z) = r3 + ( 4r1 r2 2r3)z + (5r1 + r2 + r3)z + ( 4r1 r2 2r3)y + (10r1 + 2r2 + 2r3)y z + (5r1 + r2 + 4 2 − − −2 2 2 2 4 − − − r3)y + r2x + ( 2r1 r2)x z + ( 2r1 r2)x y + r1x . When r1 = r3 = 1, one can use r2 as a control coefficient for − − − − − 2 gradually changing the shapes of the surfaces that join two half spheres with C continuity. 

Normalization To compute an algebraic surface that least-squares approximates given data, one needs to first define a distance metric which is meaningful and computationally efficient. The geometric distance of a point p from a surface S : f(x, y, z) = 0 is the Euclidean distance from p to the nearest point on S. However, computing the geometric distance from a point to an algebraic surface itself entails an expensive computational procedure, and when it is adopted for surface approximation, the problem becomes even more intractable. A commonly used approximation to geometric distance from a point to implicitly represented algebraic curves and surfaces is the value f(p), that is, the algebraic distance. Since cf(x, y, z) = 0 is the same surface for all c = 0, the coefficients of f are first normalized such that f(x, y, z) = 0 is a representation of the equivalence class cf(x, y, z)6 = 0 c = 0 . The{ normalization| we6 shall} use is a quadratic normalization of the form xT x = 1. While some variations [41, 144, 155] of a quadratic normalization have been proposed in fitting scattered planar data with conic curves, it is not easily seen how different quadratic or nonquadratic normalizations affect surface fitting when the degree of a surface is greater than two, a case of considerable interest for geometric modeling. The normalization xT x = 1 is a sphere in the coefficient vector space, and does not have singularities. That is, this normalization only eliminates the degenerate surface with all zero coefficients as a possible solution. This normalization also leads to compact and efficient algorithms for surface fitting. It remains open to T determine a generalized quadratic normalization of the form x MNx = 1, where MN is no longer the identity matrix, with good properties for surface fitting.

Least-squares Approximation

ni×nv Approximation on Algebraic Distances When the rank r of the interpolation matrix MI R is less than the dimension ∈ nv of the coefficient vector, there exists a family of algebraic surfaces which satisfy the given geometric constraints where the underdetermined coefficients can be homogeneously expressed in terms of q (= nv r) free parameters. An important problem is to interactively and intuitively select a surface which is most appropriate for a given− application. Selecting an instance surface from the family is equivalent to assigning values to each of the q parameters. One scheme for this is proposed, in [27], where interactive shape control is achieved by adjusting weights on a tetrahedral control net in the barycentric coordinate system. Least-squares approximation can also help control the shape of the resulting algebraic surface. When there are some degrees of freedom left, we may additionally specify a set of points, curves or surfaces around the given input data, which approximately describes a desirable surface. The final fitting surface can be obtained by consuming the remaining degrees of freedom via least-squares approximation to the additional data set. 62 CHAPTER 2. SETS, FUNCTIONS AND MAPPINGS

The algebraic distance f(p) is straightforward to compute and, in the case where the data point is close to a surface, approximates the geometric distance quite well. When the sum of squares of the algebraic distances of all points is minimized, one obtains algebraically nice solutions. Each row of the approximation matrix MA is computed by evaluating each term in 2 T T f(x, y, z) at the corresponding point. And, the sum of squares is expressed as MAx = x MA MAx. k k

Approximation on Contour Levels An algebraic surface f(x, y, z) = 0 can be viewed as the zero contour of an explicit function w = f(x, y, z). Sometimes it is more effective to generate approximation data for some level values wi, not only w = 0. In Bajaj and Ihm [29], this contour level approximation is found to remove unfavorable phenomena, such as singular 2 points, self intersections, holes, etc. In this case, the objective function of our minimization problem becomes MAx b , and its computational details with examples are discussed in [29]. k − k

Approximation on the First Order Approximations of Geometric Distances In addition to the algebraic distance and f(p) the contour level, we look at a nonalgebraic distance metric ∇f(p) . Sampson [155] proposed its use, in conic curve fitting, as a distance measure which is, in fact, a first order approximation to the geometric distance. With this metric, a better approximation to the geometric distance is achievable, however, only at the expense of several iterative applications of least- squares approximation.

Approximation on Hybrid Geometric Data Containment of points, curves and surfaces is not the only way to produce MA. The matrix for higher order interpolation can be used as an approximation matrix when a surface is not flexible enough for the higher order interpolation. For example, in Example ??, suppose that there are more points that must be contained in the fitting 2 surface. Then, it may not be possible that a cubic surface f3(x, y, z) = 0 not only meets f1 with C rescaling continuity 1 but also contains the extra points. If C continuity is permissible, we can generate MI for containment of the intersection curve (C1), and the points (C0) using the Hermite interpolation technique, and the matrix produced in the example can be 2 used as MA. That is, the remaining degrees of freedom, after interpolation, are used so that the C continuity requirement is satisfied as much as possible. However, further research is required to determine what relationship exists between this algebraic approximation and the geometric approximation.

Computing Optimum Solutions In the foregoing section, we showed how the algebraic surface fitting problem is trans- formed into a constrained quadratic minimization problem of the form:

T T minimize x MA MAx subject to MIx = 0 xT x = 1,

na×nv ni×nv nv where MA R , MI R , and x R . This minimization problem appears in some applications [88]. In [87], a ∈ ∈ ∈ solution is obtained by applying Householder transformations to MI to obtain its orthogonal decomposition, and then directly computing eigenvalues and eigenvectors of a reduced matrix. In this section, we consider some cases of the surface fitting problems which arise in geometric design, and describe different algorithms where the singular value decomposition (SVD) is applied to computation of eigenvalues and eigenvectors. In each case, we assume a quadratic normalization constraint which always guarantees a nontrivial solution.

Interpolation Only The first case we consider is that of interpolation alone. For example, a surface which smoothly joins four pipes is found by interpolating four curves with prescribed normals. Here, the algebraic translation of this geometric problem T is find x such that MIx = 0 and x x = 1. Finding a surface satisfying the given geometric specifications is equivalent to computing a nontrivial x in the nullspace of MI. In order for a nontrivial solution to exist, the degree of a surface must be high enough to guarantee that the rank r of MI is less than the number nv of coefficients. To find the nullspace in a computationally stable manner, we compute T ni×ni the singular value decomposition (SVD) of MI [89] where MI is decomposed as MI = UΣV where U R and nv ×nv ni×nv ∈ V R are orthonormal matrices, and Σ = diag(σ1, σ2, , σs) R is a diagonal matrix with diagonal elements ∈ ··· ∈ σ1 σ2 σs 0 (s = min ni, nv ). The rank r of MI is the number of the positive diagonal elements of Σ, and that ≥ ≥ · · · ≥ ≥ { } the last nv r columns of V span the nullspace of MI. So, the nullspace of MI is compactly expressed as : − 2.7. ALGEBRAIC FUNCTIONS 63

Figure 2.10: Corner Blending with Algebraic Surfaces

nv Pnv −r x R x = i=1 wivr+i, where wi R, and vj is the jth column of V , or x = Vnv −rw where Vnv −r nv ×{ (n∈v −r) | ∈ } ∈ R is made of the last nv r columns of V , and w a (nv r)-vector. − − xT x wT V T V w wT w 1 x For the quadratic normalization, = nv −r nv −r = = . Hence, any nonzero from the subspace of dimension nv r spanned by the last nv r columns of V can be the coefficients of a surface resulting from the interpolation − − specified by MI.

Example 2.15. (AQUINTIC SURFACE FOR BLENDINGA CORNEROFA TABLE) Generating blends that provide smooth transitions between the sharp corners and edges of solids has been recognized as one of most important problems in geometric modeling [184]. A direct application of the interpolation technique to an algebraic surface is a simply way of computing a blending surface. Consider a corner of three faces that con- sist of the first quadrants of xy, yz, zx planes. (See Figure 2.10.) First, the three edges are smoothed out by three quadratic surfaces : a cone 4z2 + 4xz 12z + 4y2 + 4xy 12y + x2 6x + 9 = 0 (red checker), another cone 10yz 25z2 +40z y2 +10xy 8y 25x2−+40x 16 = 0 (blue− checker), and− a circular cylinder (x 1)2 +(y 1)2 1 = 0 (green− checker). These− three surfaces,− − intersected with− x = 0, y = 0, and z = 0, respectively, produces− three circles− and− associ- 1+2t+t2 2 2t+2 4t −2t2+2 1+2t+t2 2 −10t 2t+2 5t2−5 ated normal vectors : CIR1 : (1, 1+t2 , 1+t2 ), ( t2+1 , t2+1 , t2+1 ) , CIR2 : ( 1+t2 , 1, 1+t2 ), ( t2+1 , t2+1 , t2+1 ) , 2 { 2 } { } 1+2t+t 2 2t 1−t and CIR3 : ( 1+t2 , 21 + t , 1), ( 1+t2 , 1+t2 , 0) . Now, we look for a quintic surface S : f(x, y, z) = 0 which smoothly interpolate the{ three curves. Our Hermite interpolation} technique generates a homogeneous linear system of 66 equations and 56 unknown coefficients. The rank of this 66 56 system is 45, hence, the dimension of the solution space is eleven. An instance surface f(x, y, z) = 0.0388z5 0.0928× yz4 + 0.1610xz4 0.2979z4 + 0.0358y2z3 + 0.2155xyz3 + 0.1259yz3 0.0924x2z3 0.5050xz3 +0.6738z3 0−.0274y3z2 0.3272xy2z2 +0− .2301y2z2 0.1092x2yz2 +0.0442xyz2 0.3133yz2 +− 0.2005x3z2 − 0.2869x2z2 + 0.7299xz−2 0.4393z2− 0.0030y4z + 0.3321xy3z −0.2238y3z 0.1341x2y2z +− 0.0963xy2z 0.0541y2z+0−.3321x3yz 0.4679x2yz −0.0340xyz+0− .4404yz 0.1311x4z 0.−0386x3z+0.4673− x2z 0.3843xz 0.1974z+− 0.0655y5 0.2883xy4 0−.0719y4+0.0297− x2y3+0.6958xy3 0−.1392y3 0.2488− x3y2+0.7195x2y2 1−.4771xy2+0−.7541y2 0.0357x4−y+0.2427x3−y 0.7298x2y+1.3307xy 0.9488y+0− .0395x5 −0.0663x4 0.0286x3 +0.3023− x2 0.5897x+0.4443− in this solution space is− shown in Figure 2.10 (skin).− − − − While computing the above quintic triangular patch for corner blending, it is observed that the surface is singular at the three vertices where three circles are tangent to each other even though we arrange that the normal vectors along the circles are compatible at the vertices. In Ihm [114], it is shown that just enforcing two curves to have the same normal vector at an intersection point does not guarantee the regularity of an interpolating surface at the point. In fact, the normal vectors along the curves must be compatible up to order two at the point, and an algebraic surface conveniently solves this problem through singularity when the normal vectors are not compatible. We also tried a quartic algebraic surface for this blending. The rank 64 CHAPTER 2. SETS, FUNCTIONS AND MAPPINGS

Y

1

-2 -1 1 2 X

-1

Points S 1

Y

1

-2 -1 1 2 X

-1

Points S 2

Figure 2.11: Points to be Approximated of the 54 35 matrix computed during C1 interpolation is 33, hence, there is a family of quartic algebraic surfaces with two degrees of× freedom. However, singularity occurs along the whole circles from the cones as well as the three vertices as predicted by the theory. This phenomenon is interpreted as an quartic algebraic surface is not powerful enough for these geometric data, and the algebraic degree must be, at least, five. 

Interpolation and Approximation In the previous subsection, w is a (nv r)-vector whose elements are free parameters that appear in coefficients of a family of algebraic surfaces. A final surface is− selected by providing proper values for w, by a process termed shape control. One method is for a user to specify an approximate shape of a desired surface with an additional set of points or curves and then let the system automatically find a solution vector w. Then, what the system needs to solve T T T efficiently is a constrained quadratic optimization problem : minimize x MA MAx subject to MIx = 0 and x x = 1. The solution to this minimization problem can be expressed analytically in closed form. From the interpolation con- straint, we get x = Vnv −rw as before. Hence, after removing the linear constraints, we are led to the problem minimize wT V T M T M V w subject to wT w = 1 V T M T M V nv −r A A nv −r . Note that nv −r A A nv −r is a positive definite matrix, and this R(w) = (wT V T M T M V w)/(wT w) R(w) problem is equivalent to minimizing the ratio of two quadratics nv −r A A nv −r . , Rayleigh’s quotient w = w V T M T M V which is called as , is minimized by the first eigenvector min of nv −r A A nv −r, and its minimum value is the smallest eigenvalue λmin [172]. V T M T M V Contrary to computing the eigenvectors and eigenvalues of nv −r A A nv −r directly as in [87], we apply singular M V V T M T M V value decomposition to A nv −r without computing nv −r A A nv −r explicitly. This leads to a numerically cheaper computation. Here, we assume thatna nv r, and that the rank of MAVnv −r is nv r. (That is, there must be enough ≥ − − T na×na linear constraints to consume the remaining degrees of freedom.) Then, MAVnv −r = P ΩQ where P R and Q (nv −r)×(nv −r) na×(nv −r) ∈ ∈ R are orthonormal matrices, and Ω = diag(ω1, ω2, , ωnv −r) R with ω1 ω2 ωnv −r > 0. ··· ∈ ≥ ≥ · · · ≥ 2.7. ALGEBRAIC FUNCTIONS 65

Figure 2.12: Two Different Least-Squares Approximations

Now,

λw = V T M T M V w nv −r A A nv −r = QΩT P T P ΩQT w = QΩT ΩQT w.

T 2 Here, Ω Ω is a (nv r) (nv r) diagonal matrix with a diagonal entry ωi > 0, i = 1, 2, , (nv r). Then, from the ΩT Ω(−QT ×w) = λ−(QT w) w V T ···M T M− V above equation, which implies that the first eigenvector min of nv −r A A nv −r is such that T T 2 Q wmin = en −r where en −r = [0, 0, , 0, 1] is a (nv r)-vector , and its minimum value λmin is ω . Hence, wmin v v ··· − nv −r is the last column of Q. Once we compute Q, we get the coefficients of the algebraic surface x = Vnv −rQenv −r, which is nontrivial, and hence satisfies the normalization constraint.

Example 2.16. (TWO QUARTIC SURFACES FOR SMOOTHLY JOINING FOUR CYLINDRICAL SURFACES) In this example, we compute a surface S : f(x, y, z) = 0 which smoothly joins four cylinders which are given as CYL1 : 2 2 2 2 2 2 2 2 y +z 1 = 0 for x 2, CYL2 : y +z 1 = 0 for x 2, CYL3 : x +y 1 = 0 for z 2, and CYL4 : x +y 1 = 0 for z − 2. ≥ − ≤ − − ≥ − The≤ interpolation− requirement is for S to meet the four curves on the cylinders with C1 continuity. Interpolation for a quartic 64×35 1 surface S generates MI R (64 linear equations and 35 coefficients) whose rank is 33. This implies a 2-parameter family of quartic surfaces∈ satisfying the interpolation constraints. Then we need to select a surface with desired shape from this family. We use least-squares approximation during this process. To illustrate the effect of approximation, two sets of points are chosen : S1 = (0, 1.75 ,0), (0, -1.75, 0), (-1, 1.25, 0), { (-1, -1.25, 0), (1, 1.25, 0), (1, -1.25, 0) and S2 = (0, 1.25, 0), (0, -1.25, 0), (-0.5, 1.125, 0), (-0.5, -1.125, 0), (0.5, 1.125, 0), (0.5, -1.125, 0) . (See Figure 2.11.) } { } For the least-squares approximation with normalization, the eigenvalues and eigenvectors for S1 and S2 are computed. As −1 −3 2 2 a result, we obtain λmin = 1.265429 10 , λmin = 5.097809 10 , and fS (x, y, z) = 0.315034x + 0.273947y + S1 · S2 · 1 0.315034z2 0.849216 0.035612x4 0.030137x2y2 0.030137x2z2 + 0.005474y4 0.030137y2z2 0.035612z4, − −2 −2 2 − 4 − 2 2 − 2 2 fS2 (x, y, z) = 0.281104x + 0.615461y + 0.281104z 0.201225 + 0.005325x 0.323706x y 0.323706x z 0.329031y4 0.323706y2z2 + 0.005325z4. The surfaces are− shown in Figure 2.12. − − − −  Example 2.17. (SMOOTHINGA SOLIDWITH TRIANGULAR ALGEBRAIC SURFACE PATCHES) Generation of a mesh of C1 surface patches that smooths a solid has been an important problem in computer aided geometric design. In [29], Bajaj and Ihm present an efficient algorithm for generating a family of curved solid objects with boundary topology related to an input solid. Given a solid with triangular faces, each edge is replaced by a conic or a cubic curve, depending on the geometry around the edge, which is, then, associated with normal vectors of the same degree along the curved edge. Each face, now made of three curves and associated normals, is fleshed with a degree five, six, or seven algebraic

1As a byproduct of interpolation process, it is found out that degree 4 is the required minimum. 66 CHAPTER 2. SETS, FUNCTIONS AND MAPPINGS

Figure 2.13: Quadric surface providing least-squares approximation of points from Example 2.18 surface patch using the interpolation and approximation technique. In this local scheme, the shape of the resulting curved solid is controlled mainly by controlling shapes of boundary curves. 

Least–Squares Approximation Only At times, one desires a surface which is only a least-squares approximation from given geometric data. This is often the case when straightforward interpolation leads to a prohibitively high algebraic degree of the resulting surface. This least-squares problem by itself, is just a special case (MI = 0) of the minimization problem in the previous subsection. In this case, Vnv −r disappears in the solution, which results in x = Qenv . Example 2.18. (LEAST-SQUARES APPROXIMATION TO POINTS :ALGEBRAIC DISTANCE) Consider that we are computing a quadric surface f(x, y, z) = 0 which approximates the following collection of points in the least-squares sense : S = (0.451663, -0.623974, 0.068396), (0.328349, -0.677433, -0.058929), (0.439221, -0.591023, -0.112337), (0.203666, -0.713408,{ -0.179608), (0.316158, -0.642981, -0.235268), (0.416159, -0.548033, -0.283786), (- 0.013524, -0.726372, -0.357700), (0.091099, -0.689252, -0.414074), (0.086853, -0.728675, -0.279685), (0.189591, -0.627654, -0.465215), (0.198347, -0.674498, -0.335774), (0.350256, -0.445695, -0.535944), (0.385507, -0.498320, -0.425321), (0.277729, -0.544938, -0.506400), (0.299997, -0.596124, -0.382735) . } 2 2 2 Each row of MA is obtained by simply evaluating, at each point, the basis of quadrics : x , y , z , xy, yz, zx, x, y, z, 1 { −7 . After applying SVD to MA, we get a quadric surface whose error-of-fit is λmin = 2.281646 10 . See Figure 2.13 } ·  In the previous example, what is minimized is the sum of squares of the algebraic distance, which is the contour level of the function w = f(x, y, z). This algebraic distance is not always the same as the geometric distance, which is the actual distance from a point to a surface. Sometimes, it is more desirable to minimize the sum of squares of the real distance. Unfortunately, this nonalgebraic metric entails an intractable minimization problem whose solution can not be expressed analytically in closed form. Sampson [155] uses a nonalgebraic distance metric, which approximates geometric distance, in fitting conic curves. This concept can be naturally extended to the surface fitting problem. We get to this nonalgebraic metric via a different derivation. 2.7. ALGEBRAIC FUNCTIONS 67

First, let us recall that the distance from a point p to a surface f(x, y, z) = 0 is the distance from p to a nearest point on the surface. Let q be the point on the surface which results in the distance. Then, the line in the direction of the normal of f at q ∇f(q) must pass through p, and q = p + t k∇f(q)k where the absolute value of t is the distance. From the Taylor’s expansion,

f(q) 0 = f(q) = f(p) + f(p) (t ∇ ) + . ∇ · f(q) ··· k ∇ k Hence, f(p) f(q) t − k ∇ k (2.35) | | ≈ | f(p) f(q) | ∇ · ∇ is the first order approximation to the distance from p to f. When p is close to the surface, f(p) is a good approximation to f(q). In this case, the expression (2.35) becomes ∇ ∇ f(p) f(p) t − k ∇ k | | ≈ | f(p) f(p) | ∇ · ∇ f(p) f(p) = − k ∇ k | f(p) 2 | k ∇ k f(p) def = | | = dist (p). f(p) f k ∇ k This argument suggests that distf (p), the weighted algebraic distance, be a good approximation to the geometric distance, and that X X f(p)2 dist (p)2 = (2.36) f f(p) 2 for all p for all p k ∇ k be minimized instead of X f(p)2. (2.37) for all p

However, the solution which minimizes the expression (2.36) can not be easily expressed in closed form due to introduction of the weight f(p) . k ∇ k This numerical intractability can be avoided by an iterative refinement algorithm. First, we compute x(0), coefficients of a surface f(0), such that (2.37), the sum of squares of algebraic distances, is minimized. To do this, MA = MA(0) is obtained as before. The gradient of f gives an initial guess to f(p). Then, dividing each row of MA by f (p) (0) ∇ k ∇ (0) k for each corresponding p results in MA(1) which is, then, singular-value-decomposed to compute x(1) and f(1). This process is repeated further producing a sequence of f(k) which refines the solution. In each iteration, f(k) is expected to be a better approximation to the surface we are trying to find.

Surfaces of Revolution From Bezout’s theorem[166], we realize that the intersection of two implicit surfaces of algebraic degree d can be a curve of geometric degree O(d2). Furthermore the same theorem implies that the intersection of two parametric surfaces of algebraic degree d can be a curve of degree O(d4). Hence, while the potential singularities of the space curve defined by the intersection of two implicit surfaces defined by polynomials of degree d can be as many as O(d4), the potential singularities of the space curve defined by the intersection of two parametric surfaces defined by polynomials of degree d can be as many as O(d8)[18]. Hence keeping the degree of fitting surfaces as low as possible benefits both the efficiency and the robustness of post processing for modeling and display[14].

Algebraic Surfaces of Revolution Consider an algebraic surface which is obtained by revolving an algebraic curve f(x, y) = 0 (on the xy plane) around the y axis. (See Figure 2.14.) Rather than restricting ourselves to a circular rotation, we consider a 2 z2 2 more general elliptic revolution where the rotation path is described by an ellipse E : x + α2 = r(y) with α > 0. Here, r(y) is the x coordinate of the point (x, y) on the curve C : f(x, y) = 0. { } 68 CHAPTER 2. SETS, FUNCTIONS AND MAPPINGS

Figure 2.14: Revolution of an Algebraic Curve along an Ellipse 2.7. ALGEBRAIC FUNCTIONS 69

2 z2 2 Now, the surface that results from revolving C along E is specified as “x + 2 = r(y) subject to f(r(y), y) = 0.” qα { } 2 z2 The equation F (x, y, z) = 0 of the surface S, hence, becomes F (x, y, z) = f( x + α2 , y) = 0 where F (x, y, z) is not necessarily algebraic due to introduction of the square root. By allowing only even-powered x’s (x0, x2, x4, ) in f(x, y), we can force F (x, y, z) to be algebraic. Geometrically, this restriction, imposed on the revolved curve, that maintains··· algebraicity, means that the curve f(x, y) = 0 is symmetric to the y axis. For quadric curves f(x, y) = 0, x2 is the only possible factor of terms in f. Hence, f includes a 4-dimensional vector 2 2 2 space Vf of polynomials over real numbers that is spanned by the basis x , y , y, 1 . In case of cubic curves f(x, y) = 0, the 3 2 2 3 2 { } vector space Vf is spanned by the basis x y, x , y , y , y, 1 with dimension 6. Quartic curves f(x, y) = 0 can be chosen 4 { } 4 2 2 2 2 4 3 2 from a more abundant vector space Vf of dimension 9, generated by the basis x , x y , x y, x , y , y , y , y, 1 . The bases d { } of vector spaces Vf for higher degree curves are formulated in the same fashion. d Each algebraic curve of degree d in Vf , revolved around an ellipse, results in an algebraic surface of the same degree. Then we naturally come to the following question : “Is a surface, generated by revolving around an ellipse an algebraic curve that d is not in Vf , algebraic at all?” In fact, the surface is algebraic, though the surface’s degree gets doubled. This doubling of the degree arises from the single squaring required to remove the square root from odd-powered x factors. For example, consider a circle f(x, y) = (x 5)2 + (y 5)2 1 = x2 10x + y2 10y + 49 = 0 of radius 1, centered at (5, 5). This conic curve 2 − − − − − is not in Vf because of the term 10x. However, by moving 10x to the right hand side, and then squaring both sides, we can 4 obtain a quartic curve in Vf which generates a torus (of degree 4) by rotation. Intuitively, the squaring operation has an effect of putting another circle of the same shape to the other side of the y axis in order to artificially make the curve symmetric to the d 2d y axis. Any algebraic curve of degree d which is not in Vf can be made to be in Vf by moving all terms with odd-powered x factors to one side, and squaring both sides. 2 z2 2 Remark 2.19. Let C : f(x, y) = 0 be an algebraic curve of degree d, and E : x + α2 = r(y) be an ellipse of a rotation path. Then, the algebraic surface S : F (x, y, z) = 0, resulting from revolving C around E{, has} degree d if C is symmetric around the y axis, or 2d otherwise. A geometric interpretation to Remark 2.19 is as follows : Consider a line on the xy plane parallel to the x axis. This line intersects with C at most d times. Now, imagine the intersection between the line and S. When C is symmetric, the number of intersection remains the same. However, if C is not symmetric, the number of intersection is doubled up because C, rotated by 180 degrees, creates the same number of line-curve intersections. d It is important to understand that, the degrees of freedom, in choosing a curve f(x, y) = 0 of degree d from Vf , is d d dim(Vf ) 1 where dim( ) is the dimension of a vector space. Since all the polynomials on a line in Vf that passes through − ∗ d f and 0 describe the same curve, we have one less than dim(Vf ) degrees of freedom. It is not hard to come up with the d expression for dim(Vf ) :

( (d+2)2 d 4 if d is even dim(Vf ) = (d+1)(d+3) 4 if d is odd In many situations as will be shown later, the curve f(x, y) = 0 is to be designed such that it satisfies given geometric requirements. We are interested in designing piecewise curves from given digitized data, and revolving them in a complicated manner to model some class of objects with low degree algebraic surfaces. It will be explained below how the degrees of freedom in piecewise algebraic curves of a given degree limit the geometric continuity between them.

Example 2.20. Figure 2.15 (a) and (b) displays two quartic algebraic curves (x2 + y2)2 + 3x2y y3 = 0 and x4 + x2y2 2x2y xy2 +y2 = 0, respectively [177]. The curves, after rotation, result in algebraic surfaces of degree− 4 and 8, respectively,− and shown− in Figure 2.16 (a) and (b).

Parametric Surfaces of Revolution Now, we get to a question : “Is it also possible to find a restricted bases of rational parametric curves that result in rational parametric surfaces of the same geometric degree after revolution around an axis?” Consider a rational parametric curve of degree d

x(t) !  X(t)  C(t) = = w(t) Y (t) y(t) w(t) 70 CHAPTER 2. SETS, FUNCTIONS AND MAPPINGS

Figure 2.15: Two Quartic Algebraic Curves

Figure 2.16: Degree 4 and 8 Algebraic Surfaces of Revolution where the degrees of the polynomials x(t), y(t), and w(t) are at most d. The surface obtained by revolving C(t) around y-axis 2 along an ellipse E : x2 + z = r(y) 2 with α > 0 can be represented as F (s, t) = (X(s, t),Y (s, t),Z(s, t)), where α2 { } 2s x(t) X(s, t) = 1 + s2 w(t) y(t) Y (s, t) = w(t) α(1 s2) x(t) Z(s, t) = − . 1 + s2 w(t)

First, this representation answers that the revolved surface is always rational parametric. Then, the second question on the degree of F (s, t) must be answered. We are interested in lowering both the algebraic degree in the polynomials in F (s, t) and the geometric degree of F (s, t) (the maximum possible intersection of F (s, t) with a line). In construction of rational parametric revolved surfaces, we follow the same path we did in the previous subsection. From Remark 2.19, we know that an algebraic curve of degree d generates an algebraic surface of the same degree only when it is symmetric around an axis. Since every rational parametric curve of degree d is an algebraic curve of degree d, we are led to the fact that F (s, t) is of degree d if C(t) is symmetric around the y-axis. x(t) y(t) A rational parametric curve is symmetric if there is a parametrization C(t) = (X(t),Y (t)) = ( w(t) , w(t) ) such that X(t) = X( t) and Y (t) = Y ( t). That is, − − − x(t) x( t) = − (2.38) w(t) −w( t) − y(t) y( t) = − (2.39) w(t) w( t) − The above conditions are met if either x(t) is an odd function (all the terms with nonzero coefficients are odd-powered), and y(t), w(t) are even functions (all the terms with nonzero coefficients are even-powered), or x(t) is an even function, and y(t), w(t) are odd functions. It is not difficult to see that the polynomials in the second case can be converted into the first case 2.7. ALGEBRAIC FUNCTIONS 71

Figure 2.17: Symmetric C1 Cubic and C2 Quartic Algebraic Splines polynomials by multiplying t to both numerator and denominator, and vice versa. In fact, any polynomials that satisfies the conditions (2.38) and (2.39) fall in the above two categories. Lemma 2.21. Let x(t), y(t), and w(t) be polynomials in t such that x(t) and w(t) are relatively prime, and y(t) and w(t) x(t) x(−t) are relatively prime. Then, x(t) is an odd function, and y(t), w(t) are even functions if and only if w(t) = w(−t) and y(t) y(−t) − w(t) = w(−t) . PROOF : See [28]. 

From now on, we assume that x(t) is an odd function, and y(t) and w(t) are even functions without loss of generality. x(t) y(t) Since a degree d curve C(t) = (X(t),Y (t)) = ( w(t) , w(t) ) is symmetric around y-axis, the surface made by revolving it around y-axis is a surface of geometric degree d. The surface equation F (s, t) given above is represented by degree d + 2 polynomials. In [28] we show it is possible to reduce the algebraic degree of the parametric surface equations to d by applying a transformation to F (s, t). x(t) y(t) Remark 2.22. Let C : C(t) = ( w(t) , w(t) ) be a rational parametric curve of degree d where x(t) is an odd function, and 2 z2 2 y(t), w(t) are even functions, and E : x + α2 = r(y) be an ellipse of a rotation path. Then, the algebraic surface S : F (s, t) = (X(s, t),Y (s, t),Z(s, t)) in the rational{ parametric} form, resulting from revolving C around E, has geometric degree d, and can be parameterized in the way that X(s, t), Y (s, t), and Z(s, t) are degree d rational polynomials. The class of the above rational parametric curves contains symmetric parametric curves that intersect with y-axis. The set of all such curves is only a proper subset of all symmetric parametric curves. Another interesting class of symmetric rational x(t) y(t) 1 1 2 parametric curves is defined as C(t) = (X(t),Y (t)) = ( w(t) , w(t) ) such that X(t) = X( t ) and Y (t) = Y ( t ) . It still remains open how to specify all the bases of symmetric rational parametric curves of a given− − degree. −

t3−3t t4−3t2 Example 2.23. Recall the “three-leaf clover” in Example 2.20. Its parametric form is C(t) = ( t4+2t2+1 , t4+2t2+1 ). Af- u(u2+v2−3) ter circular revolution and the above mentioned reparametrization, the quartic surface is F (u, v) = ( (u2+v2)2+2(u2+v2)+1 , (u2+v2)2−3(u2+v2) v(u2+v2−3) (u2+v2)2+2(u2+v2)+1 , (u2+v2)2+2(u2+v2)+1 ) and shown in Figure 2.16 (a).

Piecewise Ck Continuous Revolved Objects Figure 2.17 (a) displays piecewise C1 approximation with cubic algebraic 3 3 curves in the restricted basis Vf . Note that a symmetric cubic curve in Vf can have a tangent line parallel to x-axis only at points on the y-axis. Hence, the order of geometric continuity is only 0 at the extreme junction points on the cowls around which 4 the curve segments make vertical turnabouts. With symmetric quartic algebraic curves in Vf , it is possible to approximate the

2For example, a hyperbola is in this class. 72 CHAPTER 2. SETS, FUNCTIONS AND MAPPINGS

Figure 2.18: Symmetric C1 and Arbitrary C2 Cubic Algebraic Splines

Figure 2.19: C1 Cubic and C2 Quartic Revolved Surface Models

Figure 2.20: C1 Cubic and C2 Sextic Revolved Surface Models 2.8. PIECEWISE POLYNOMIALS, GEOMETRIC CONTINUITY, FINITE ELEMENTS 73

2 3 point data with C continuity everywhere. (See Figure 2.17 (b).) For the goblet data, cubic curves in Vf , again, successfully model the data with C1 continuity in Figure 2.18 (a). Figure 2.18 (b) shows a C2 approximation of the same data with cubic curves in the general basis, which, hence, may not be symmetric about the y-axis. Once algebraic splines are constructed to fit the digitized data, their revolution surface models are easily obtained, with the appropriate surface degree bounds. C1 approximation with cubic algebraic surfaces is shown in Figure 2.19 (a) and are a revolution of the cubic splines in Figure 2.17 (a). Quartic algebraic surfaces approximate the same object well with C2 continuity in Figure 2.19 (b) and are a revolution of the quartic splines in Figure 2.17 (b). A C1 cubic algebraic surface goblet is illustrated in Figure 2.20(a) and is obtained by revolving the symmetric cubic spline in Figure 2.18 (a). The C2 goblet in Figure 2.20(b) is obtained by revolving the arbitrary cubic splines in Figure 2.18 (b), and is made of degree 6 algebraic surfaces.

2.8 Piecewise Polynomials, Geometric Continuity, Finite Elements 2.8.1 Bernstein-Bezier Barycentric coordinates are a natural method for describing a function defined on a triangle. We begin with the simplest possible case of describing a line passing through a triangle. Let T be a triangle with vertices (x1, y1), (x2, y2), (x3, y3). To represent a line C implicitly, we could find real coefficients cij R of a function ∈ X i j g(x, y) = cijx y = c00 + c10x + c01y i+j≤1 such that C = g = 0 . Since the function g is defined in terms of the global coordinates x and y, it is not immediately obvious { } given the coefficients cij whether C passes through T at all. Thus, we transform the (x, y) coordinates to real barycentric coordinates (λ1, λ2, λ3) via       x x1 x2 x3 λ1  y  =  y1 y2 y3   λ2  1 1 1 1 λ3

Under the mapping, (x1, y1) becomes (1, 0, 0), (x2, y2) becomes (0, 1, 0), and (x3, y3) becomes (0, 0, 1). We can now seek real coefficients γi R of a function ∈ 3 X g(λ1, λ2, λ3) = γiλi i=1 such that C = g = 0 . The coefficients are very easily described: γi is the value of g at (xi, yi). Accordingly, if at least one { } γi is positive and at least one is negative, C will pass through T , intersecting at the edges between vertices with opposite signs. Thus, barycentric coordinates give us an easy way to define and control the shape of lines through a triangle. To describe more complicated curves through T , we use a generalization of barycentric coordinates. Fix a degree n 1 and compute the trinomial expansion of ≥ d (λ1 + λ2 + λ3) = 1.

d + 2 i j k This will yield 2 terms of the form λ1λ2λ3 with i + j + k = n. These functions, called the Bernstein polynomials, form a basis for degree n polynomials in R2 and can be used analogously to the linear case. In standard coordinates, we could find real coefficients cij R ∈ X i j g(x, y) = cijx y i+j≤n such that C = g = 0 . This problem is much more difficult than the linear case, making the barycentric coordinate change { } essential. We seek instead the real Bernstein-Bézier coefficients γijk R of the function ∈ X d! g(λ , λ , λ ) = γ λi λj λk (2.40) 1 2 3 ijk i!j!k! 1 2 3 i+j+k=n such that C = g = 0 . As with barycentric coordinates, the coefficient at a vertex of the triangle is exactly the value of g at the vertex, for example{ } γ300 = g(1, 0, 0) = g(x1, y1). 74 CHAPTER 2. SETS, FUNCTIONS AND MAPPINGS

The remaining coefficients control the properties of g (and hence its level sets) within T . The coefficients are associated to the domain points on a regular subdivision of the triangle. We show examples of such subdivisions for n = 2 and n = 3 in Figure 2.21.

Figure 2.21: Domain points associated to Bernstein-Bézier coefficients for n = 2 (left) and n = 3 (right).

The bases are defined for restricted subdomains of the defining space as opposed to the power basis which is defined for all points of the space. The example formulations given below are defined for values of each of the variables x, y and z in the unit interval [0,1]. Bernstein-Bézier Basis (BB) Univariate: m X m P (x) = wjBj (x) j=0 where m Bm(x) = xi(1 x)m−i i i − Bivariate: (1) Tensor: m n X X n n P (x, y) = wijBi (x)Bj (y) i=0 j=0 (2) Barycentric: m m−i X X n P (x, y) = wijBij(x, y) i=0 j=0 where m Bm(x, y) = xiyj(1 x y)m−i−j ij ij − − Trivariate: (1) Tensor: m n p X X X n n n P (x, y, z) = wijkBi (x)Bj (y)Bk (z) i=0 j=0 k=0 (2) Mixed: m m−i p X X X n n P (x, y, z) = bijkBij(x, y)Bk (z) i=0 j=0 k=0 (3) Barycentric: m m−i m−i−j X X X m P (x, y, z) = wijkBijk(x, y, z) i=0 j=0 k=0 2.8. PIECEWISE POLYNOMIALS, GEOMETRIC CONTINUITY, FINITE ELEMENTS 75 where  m  Bm (x, y, z) = xiyjzk(1 x y z)m−i−j−k ijk ijk − − − Multivariate (n-variate):

n n X1 Xd p(x , . . . , x ) = ... b Bn1 (t )Bn2 (t ) ...Bnd (t ) (2.41) 1 d i1i2...id i1 1 i2 2 id d i1=0 id=0 where

T (x1, . . . , xd) [a1, b1] [a2, b2] ... [ad, bd] ∈ × × ×

xi−ai ti = , i = 1, 2, . . . , d bi−ai

Bn(t) = n! ti(1 t)n−i i i!(n−i)! − Bernstein Form on a Simplex   d p0 p1 ... pd Let p0,..., pd R be affine independent. That is the matrix is non-singular. Let ∈ 1 1 ... 1     x1 α0  .   p p ... p   α1   .  = 0 1 d   (2.42)   1 1 ... 1  .   xd   .  1 αd

Then the Bernstein form on the simplex [p0,..., pd] is X p(x , . . . , x ) = b Bn (α , . . . , α ) 1 d i0i1...id i0i1...id 0 d (2.43) i0+i1+...+id=n where T (x1, . . . , xd) [p ,..., p ], ∈ 0 d n! Bn (α , . . . , α ) = αi0 αi1 . . . αid i0i1...id 0 d 0 1 d i0!i1! . . . id! Since d d X X ij = n, αj = 1 j=0 j=0 (1.6) can also be written as X p(x , . . . , x ) = b B˜n (α , . . . , α ) 1 d i1...id i1...id 1 d (2.44) i1+...+id≤n where n! B˜n (α , . . . , α ) = αi1 αi2 . . . αid (1 α ... α )n−i1−...−id i1...id 1 d 1 2 d 1 d i1!i2! . . . id!(n i1 ... id)! − − − − − − and bi1...id = bi0...id .

Mixed Multivariate Bernstein Form

d1 Let d = d1 + d2, p0,..., pd R be affine independent. Then the mixed Bernstein form is 1 ∈

n1 nd2 n X X X ˜m n2 d2 p(x1, . . . , xd) = ... bi1...id j1...jd B (α1, . . . , αd1 ) B (t1) ...B (td2 ) (2.45) 1 2 i1...id1 j1 jd2 i1+...+id1 ≤m j1=0 jd2 =0 76 CHAPTER 2. SETS, FUNCTIONS AND MAPPINGS where T (x1, . . . xd) [p ,..., p ] [a1, b1] ... [ad , bd ] ∈ 0 d1 × × × 2 2     x1 α0  .   p p ... p   α1   .  = 0 1 d1     1 1 ... 1  .   xd1   . 

1 αd1 and xd1+i ai ti = − i = 1, 2, . . . , d2 bi ai − If d1 = 0, then p is the Bernstein form on hypercube. If d2 = 0, then p is the Bernstein form on simplex.

Chebyshev basis Viro’s theorem 2.9 A-Splines, B-Splines, Box-Splines 2.9.1 B-Spline Basis The B-spline basis over the unit interval [0,1] is easily generated by a fractional linear recurrence as given below for the uni- variate case. The bivariate and trivariate forms can also be similarly generated from this in either tensor product or barycentric form, as given for the BB form above. Univariate: m X n Pn = plNl (x) l=0 where ( 1 for xl xl+1 N 1(x) = ≤ l 0 otherwise. and knot sequence 0 = u0 u1 < . . . < um+1 = 1 ≤ n x xl−1 n−1 xl+n x n−1 Nl (x) = − Nl (x) + − Nl+1 (x) xl+n−1 xl−1 xl+n xl − − Both the parametric and the implicit representation of algebraic curve segments and algebraic surface patches can be repre- sented in either of the above BB or B-spline bases. Note that the canonical representation of a parametric plane curve segment and surface patch in x, y, z space are given as follows. Curve:  x = P (t),  1 y = P2(t),  w = P3(t). Surface:  x = P1(s, t),  y = P2(s, t), z = P3(s, t),  w = P4(s, t). where the Pi are polynomials in any of the above appropriate bases and the variables/parameters s, and t range over the unit interval [0,1]. An implicit curve segment and surface patch can be defined in x, y, z space by Curve: z = P (x, y) z = 0 ∧ 2.9. A-SPLINES, B-SPLINES, BOX-SPLINES 77

P 0003 0 positive control points free control point 0003 p4 1002 zero control point 0102 1002 negative control point 2001 0012 0012 2001 0102 0201 p1 1101 3000 1101 0021 0111 1011 0111 1011 0201 P 3 2010 0300 3000 2100 2100 0021 1020 1200 1110 p 2010 3 P 1 1110 1200 0030 negative control point 0120 0210 1020 free control point 0210 0300 0120 zero control point p2

0030 positive control points P 2 (a) (b)

Figure 2.22: (a) A three sided patch tangent at P1, P2, and P4. (b) A degenerate four sided patch tangent to face [p1p2p4] at p2 and [p1p3p4] at p3

Surface: w = P (x, y, z) w = 0 ∧ where the P is a polynomial in any of the above appropriate basis and the variables x, y, z range over the unit interval [0,1]. The work of characterizing the BB form of polynomials within a tetrahedron such that the zero contour of the polynomial is a single sheeted surface within the tetrahedron, has been attempted in the past. In [164], Sederberg showed that if the coefficients of the BB form of the trivariate polynomial on the lines that parallel one edge, say L, of the tetrahedron, all increase (or decrease) monotonically in the same direction, then any line parallel to L will intersect the zero contour algebraic surface patch at most once. In [99], Guo treats the same problem by enforcing monotonicity conditions on a cubic polynomial along the direction from one vertex to a point of the opposite face of the vertex. From this he derives a condition aλ−e1+e4 aλ 0 T − ≥ for all λ = (λ1, λ2, λ3, λ4) with λ1 1, where aλ are the coefficients of the cubic in BB form and ei is the i-th unit vector. This condition is difficult to satisfy in≥ general, and even if this condition is satisfied, one still cannot avoid singularities on the zero contour. In[22, 23] sufficient conditions of a smooth, single sheeted zero contour generalizes Sederberg’s condition and provides with an efficient way of generating nice implicit surface patches in BB-form (called A-patches for algebraic patches). See Figures 2.22 and 2.23.

2.9.2 Implicit Algebraic Surface Patches An implicit algebraic surface patch can be defined in x, y, z space by :

w = P (x, y, z) w = 0 ∧ where the P is a polynomial in any of the above appropriate basis and the variables x, y, z range over the unit interval [0,1]. Alternatively, the surface patch can be defined by a closed cycle of trimming curves which may be defined with rational parametric equations or implicitly or both. In section 3 the surfaces patches are defined implicitly with a closed triple (triangle) of rational trimming curves. As in the Rational parametric representation, we have many elements over which we can define the patches. In general, the simplest polyhedron we consider are

Cube (Tensor domain) The parameters x, y, z are defined over the interval [0,1]. ( x [0, 1], y [0, 1], z [0, 1] ) This • yield a tensor product Bernstein-Bézier coordinate system for trivariate polynomials.∈ ∈ ∈ 78 CHAPTER 2. SETS, FUNCTIONS AND MAPPINGS

A 3000 A 3000

2001 2001 2100 2100

1002 2010 1002 1101 1101 2010 1200 1200 1011 1110 0102 D 1110 0102 1011 D 0003 0003

1020 B 0201 1020 0012 B 0201 0012 0300 0111 0300 0111

0210 0210 0021 0021 negative control point 0120 negative control point 0120

free control point 0030 free control point C 0030 C zero control point zero control point positive control points positive control points (a) (b)

Figure 2.23: (a) A three sided patch interpolating the edge CD (b) A three sided patch interpolating edges BD and CD

Tetrahedron The parameters x, y, z are defined with the condition: 0 x + y + z 1. This yields a barycentric • coordinate system for trivariate polynomials. ≤ ≤

Triangular prism The parameters x, y, z are now defined as follows: z is defined over the interval [0,1]. ( z [0, 1] ) and • x, y range over 0 x + y 1 ∈ ≤ ≤ Square pyramid The parameters x and y satisfy x [0, 1] and y [0, 1], while z satisfies the condition 0 x+y +z 1 • ∈ ∈ ≤ ≤ 2.9.3 Parametric basis 2.10 Biological Applications

Complementary space visualization can be used for model checking, error analysis, detection of topologically uncertain regions, topological preservation in model reduction, and dynamic deformation visualization, as we outline in the following subsections.

2.10.1 Tertiary Motif Detection Using the Morse-Smale complex and stable and unstable manifolds, we can detect helices and sheets in molecular structures as well as large scale ‘tertiary motifs’.

2.10.2 Ion channel models Ion channels are a cell’s mechanism for regulating the flow of ions into and out of the cell. They usually have two main structural confirmations: the “open” configuration, in which the tunnel through its center is wide enough to allow passage of the ions, and a “closed” configuration in which it is not. We look at the acetylcholine receptor (PDB ID 2BG9) as a particular example of an ion channel. This molecule is embedded in a cell membrane, as shown in Figure 2.24a, and is a control mechanism for the flow of sodium and potassium ions into the cell. It is made up of five homologous (in the biological sense) subunits. A conformational change from closed to open occurs when acetylcholine, a small neurotransmitter ligand, docks into the five small pockets on the exterior of the molecule near the tunnel opening in the extracellular region. In particular, when acetylcholine fills one of these pockets, it causes the attached chain subunit of 2BG9 to twist slightly. The combined effect from rotations in all five chains is a widening of the mouth of the tunnel, akin to the opening of a shutter on a traditional camera. 2.10. BIOLOGICAL APPLICATIONS 79

(a) (b) (c)

(d) (e) (f)

Figure 2.24: Various visualizations of the acetylcholine receptor molecule. The top and bottom rows shows primal and com- plementary space visualizations, respectively. (a) The molecule is shown as it would sit embedded in a bilipid cell membrane (grey) with the five identical subunit colored for identification. (b) A cut-away view of the same model showing where ions may pass through the center. (c) A transparent view of the molecular surface. (d) Each subunit contains a pocket where acetyl- choline binds. The pocket interior (green) and its mouth (purple) are shown in a zoomed in view after the surface has been made transparent. (e) A cut-away view of the surface with the interior of the tunnel (yellow) and its mouths (red) identified. (f) The same view as (c) with the tunnel geometry opaque, showing how it lies inside the surface. 80 CHAPTER 2. SETS, FUNCTIONS AND MAPPINGS

(a) (b) (c)

Figure 2.25: Three visualizations of the ribosome molecule. (a) A primal space visualization showing the two subunits in their joined state. (b) A cut-away view of the molecule with the protein exit tunnel visible diagonally from upper left to bottom right. (c) A complementary space view of the exit tunnel indicates its intricate three-dimensional geometry in a way that the primal and cut-away views do not.

From this description of the action of the acetylcholine receptor, the importance of accurate complementary space topology becomes evident. First, an accurate model of the channel must feature a tunnel passing completely through the length of the surface. Put differently, the complementary space should include a connected component running the length of the molecule with mouths at opposite ends. Such a requirement can be quickly verified by a complementary space visualization as shown in Figure 2.24. Furthermore, the diameter of this tunnel at its narrowest point should be within the range of biological feasibility, i.e. it should be wide enough to accommodate sodium and potassium ions in the open confirmation and narrow enough to block them in the closed confirmation. The margin of error here is quite small as the channel, when open, selectively allows the desired ions and not ions of similar size, e.g. magnesium or calcium. Measuring this width is straightforward with a geometrical representation of the tunnel. Additionally, the model must have correct geometry at the ligand binding site. In terms of complementary space, this implies the existence of a small component with one mouth on each of the subunits such that its volume and mouth diameter are of plausible size compared to the acetylcholine molecule. We show a visualization of the pocket in one subunit in Figure 2.24 d. While such features are difficult to visualize and measure with a model based primal space, they much easier to detect and manipulate with a model based on complementary space.

2.10.3 Ribosome models

The ribosome molecule provides another example of natural structural questions best answered with a complementary space model. Ribosomes live inside cells and are the construction equipment for proteins made within the cell. When a ribosome receives the end of a mRNA chain, it passes the mRNA through a small tunnel in its surface. (More precisely, it opens a flap that pulls the end of the mRNA in, then closes around it). The mRNA is a copy of the DNA data from the nucleus of the cell and codes for the construction of a specific protein. The presence of the mRNA in the ribosome allows specific amino acids to enter a larger tunnel through the ribosome; the type of amino acid permitted to enter depends on the portion of mRNA code in the ribosome at the moment. As the mRNA is fed through, amino acids are linked into a chain, forming the desired protein. Figure 2.25 shows three visualizations of the ribosome molecule: a primal space view, a cut-away view, and a complementary space view. Since the ribosome has two tunnels of biological significance, an obvious question is to determine the widths of each tunnel. In particular, it would be interesting to compare the width of the mRNA tunnel to the diameter of the mRNA molecule to get a sense of the variation in width that the ribosome will tolerate. Similar questions could be asked of the larger tunnel accommodating the amino acids. The complementary space of the ribosome’s surface includes a component for each tunnel. 2.10. BIOLOGICAL APPLICATIONS 81

(a) (b) (c)

(d) (e) (f)

Figure 2.26: Visualizations of the Carter dataset. (a) A basic primal space visualization of the mechanical part . (b-c) Com- plementary space features identified and visualized. (d) A visualization of the dense mesh representing the surface reveals that at 106,708 triangles, it is probably amenable to decimation. (e) Using QSlim [79], the mesh is decimated to 1000 triangles. Prominent topological and geometrical features are still present, though the geometry of the smaller tunnels has changed. (f) Decimated to 500 triangles, some of the smaller tunnels have collapsed, causing a topological change in the model. Visualizing complementary space could aid in detecting such changes.

Visualizing these components gives clues to the tunnels’ structure and applicable measurements of mouth sizes and tunnel lengths can then be made.

2.10.4 Topological Agreement of Reduced Models Model reduction or decimation is the process of removing geometrical information from a model while attempting to keep sufficient data for maintenance of important features. This is used, for example, in coarse-grained models of proteins, used prominently in electrostatic simulations [36]. Protein surfaces are often defined based on atomic positions and radii, obtained from the PDB. For large proteins, a significant speed-up in computational time can be achieved by grouping atoms into clusters and treating the clusters as single atoms with an averaged radius. Model reduction is also common for point-sampled surfaces such as CAD models and geometries acquired from three-dimensional scanners. If points on the surface can be culled without dramatic effect on the shape of the surface, subsequent visualization and simulation pipelines will experience a reduction in computational cost. In all model reduction contexts, a primary concern is whether the reduction has changed the topology. Put more precisely, we would like to know when, if ever, the original topology is lost in the progressive decimation of a surface. Complementary space visualization is a natural tool in this context. We consider, for example, the industrial part model shown in Figure 2.26. We use the software QSlim [79] to decimate the model from 106,708 triangles to only 1000 and then only 500. At 1000 triangles, the model has lost some geometrical precision, but still has the same number of tunnels. At 500 triangles, however, 82 CHAPTER 2. SETS, FUNCTIONS AND MAPPINGS some of the smaller tunnels have collapsed, representing a fundamental change in the model. Such changes would be evident from a complementary space visualization.

2.10.5 Dynamic Deformation Visualization Complementary space aids in visualizing and quantifying dynamic deformations of models in addition to its aid for static models previously discussed. The omnipresent consideration in a computer generated simulation of real movement is always whether the dynamics are realistically plausible. In the context of molecular modeling, such considerations are especially difficult to formalize as current video technology cannot capture a molecule in vivo for comparison. As a result, various techniques have been developed for automated animation of molecular models, including the popular of which is Normal Mode Analysis (NMA) [123, 173]. To determine whether the fluctuations simulated by these means have any functional significance to the molecule, we must be able to measure the extent of changes in particular features of the surface. This is especially important in molecules which perform specific actions by modifying their complementary space features, such as the ribosome. With a model of complementary space, we can measure the area of the mouth of a tunnel or pocket used in the various processes and compare the sizes before and after a conformational change. This gives insight into the relative magnitude of different aspects of the shape reconfiguration; a seemingly significant deformation may only involve a small change in the size of a pocket mouth or vice versa.

Summary References and Further Reading

Algebraic curves are handled here in real projective space but the interested reader should consider how they can be understood in the additional structure provided by complex projective space. The exposition of exterior calculus in the continuous setting is based on the presentations in [7, 98].

Exercises Chapter 3

Differential Geometry, Operators

3.1 Shape Operators, First and Second Fundamental Forms 3.1.1 Curvature: Gaussian, Mean 3.1.2 The Shape of Space: convex, planar, hyperbolic 3.1.3 Laplacian Eigenfunctions 3.2 Finite Element Basis, Functional Spaces, Inner Products 3.2.1 Hilbert Complexes Definition 3.1. A real Hilbert space W is a vector space with a real-valued inner product ( , ) such that W is complete with respect to the norm given by · · 1/2 w W := (w, w) . || || A Hilbert complex (W, d) is a sequence of Hilbert spaces W k and a sequence of closed, densely defined linear operators k k+1 dk : W W such that the range of dk is contained in the kernel of dk+1, i.e. →

dk+1 dk = 0. ◦ k k The domain complex (V, d) associated to (W, d) is the sequence of spaces V := domain(dk) W along with the graph norm defined via the inner product ⊂ (u, v)V k := (u, v)W k + (dku, dkv)W k+1 . ♦ Definition 3.2. The space of L2-bounded differential forms along with the exterior derivative map define a Hilbert complex (L2Λ, d). The associated domain complex, denoted (HΛ, d) is called the L2 deRham complex:

d d dn−1 0 / HΛ0 0 / HΛ1 1 / / HΛn / 0 ··· ♦

3.3 Topology of Function Spaces 3.4 Differential Operators and their Discretization formulas discrete and continuous formulas

83 84 CHAPTER 3. DIFFERENTIAL GEOMETRY, OPERATORS

3.5 Conformal Mappings from Intrinsic Curvature

Conformal Maps

A conformal map f : X Y is function which preserves angles. In the mapping shown in the figure, the rectangular grid is distorted→ by f but the 90 angles at each grid point (and indeed everywhere) are preserved in an infintesimal sense. Conformal maps are useful when paramaterizing molecular surfaces as a triangulation with good angle bounds will preserve the angle bounds when passed to through the parametrization to a surface triangulation. To create a global conformal parameterization of a surface Ω with arbitrary topology, one must sovle the following problem. Let Ω be a surface of genus g and let L1,...,L2g be a set of loops providing a basis for the 1-homology group of Ω. Let { } c1, . . . , c2g R where ci represents the desired value of the integral of the gradient field around ei. ∈ The goal is to find a conformal gradient field ω + √ 1 ? ω where ω and ?ω are real gradient fields on Ω. Further, ω and ?ω should be closed, harmonic, determined by their values− of integration over the homology basis, and orthogonal to each other. This means ω should solve the following PDE:  dω = 0  ∆ω = 0 R  ω = ci ei Given a solution to the above, one can construct an appropriate ?ω as well. The approach below is based on that of Gu and Yau [96] Section 3.2. Approach: Let M be a mesh of Ω with the correct topology. The computation of the homology basis is as follows .

1. Compute the dual mesh M¯ of M. The dual mesh has a face for every vertex of M, a vertex for every face of M, and an edge for every edge of M with connectivity provided in the standard manner.

2. Find a minimal spanning tree T¯ of the vertices of M¯ .

3. Define the graph G to be those edges of M whose dual edge is not in T¯. Then G is a cut graph of M, meaning M/G is topologically a disk and G has 2g loops, corresponding to homology basis elements.

4. Construct a maximal spanning tree T of G. Since G has 2g loops, G T is exactly 2g edges e1, . . . , e2g , one per loop of G. − { } 3.6. BIOLOGICAL APPLICATIONS 85

5. Each ei connects two leaves of the tree T . Let Li denote the loop in G consisting of the path from one of these leaves to the root of T , down the other leaf, and across ei. Then L1,...,L2g are non-trivial, independent (i.e. not homotopic { } nor homologous) loops in G, and hence form a basis for the first homology group H1(M, Z) The PDE is discretized as follows. Let [u, v] denote an oriented edge and [u, v, w] denote an oriented face in the mesh M. For an edge [u, v], let α, β be the angles against the edge at u and define 1 ku,v := (cot α + cot β). −2

Also, for each homology basis element Li, write

ni X i i Li = [uj−1, uj], u0 = uni . j=1

Then the PDE is discretized as  P3 j=1 ω([uj−1, uj]) = 0 [u0, u1, u2] M, u0 = u3  P ∀ ∈ [u,v]∈M ku,vω([u, v]) = 0 u M Pni i i ∀ ∈  ω([u , u ]) = ci Li j=1 j−1 j ∀ The authors prove this linear system is of full rank, hence it has a solution. In words, the above equations seek a vector field ω such that:

ω integrated around any face is zero (so dω = 0) • At each vertex u of the mesh, summing the values of ω on the edges around u with appropriate cotangent weights is zero • (so ω is harmonic in the discrete sense) The integral of ω around each homological basis element has a prescribed value. • A basis for the solution set would be ωi where for ωi, set ci = 1 and set cj = 0 for j = i and solve the above. Then ωi has { } 6 value 1 when integrated around Li and value 0 when integrated around any combination of basis elements besides Li.

3.6 Biological Applications 3.6.1 Molecular Surface Analysis 3.6.2 Solving PDEs in Biology Summary References and Further Reading

For more on conformal mapping, see [160, 96, 117, 167]

Exercises 86 CHAPTER 3. DIFFERENTIAL GEOMETRY, OPERATORS Chapter 4

Differential Forms and Homology of Discrete Functions

4.1 Exterior Calculus

Recall the definitions of tensors and exterior algebra given in Section 2.1. Let Ω be an n-manifold embedded in some RN with n N. Minimally, we will assume Ω is a bounded subset, but we will usually consider the case n = N = 3 and assume Ω has a piecewise≤ smooth, Lipschitz boundary as this allows us to identify Ω with its primal mesh (Definition 1.10) or dual mesh (Definition 1.14).

Definition 4.1. Let Ω be a manifold of dimension n. Given a point x Ω, we denote the tangent space of Ω at x by Tx(Ω). Let 0 k n.A k-form ω is a mapping from Ω to the space of alternating∈ k-tensors on the tangent space of Ω at the input point.≤ We use≤ the notation k k ∗ M ω :Ω Λ [Tx(Ω) ], ω(x): Tx(Ω) R, → → i=1 where ω(x) is an alternating k-tensor. A 0-form is taken to mean a real-valued function on Ω. We denote the space of k continuous differential k-forms on Ω by Λ (Ω). ♦ th Definition 4.2. A differential dxi is a 1-form whose action at x M is to assign the i value of the input vector from Tx(M). ∈ Let I = i1, . . . , ik be a list of indices. Define { } dxI := dxi dxi . 1 ∧ · · · ∧ k We use the notation aI to a real-valued function in the variables of I.

Theorem 4.3. If dx1, . . . , dxn is an orthonormal basis for Tx(Ω) then { } dxI : I = i1, . . . , ik , 1 i1 < < ik n { { } ≤ ··· ≤ } is a basis for Λk(Ω). Put differently, any k-form ω Λk(Ω) can be written in the form ∈ X ω = aI dxI I where I ranges over all strictly increasing sequences of k indices. The theorem is a standard result from differential topology. Definition 4.4. The space of L2-bounded continuous differential k-forms on Ω is given by ( ) 2 k X k 2 L Λ (Ω) := aI dxI Λ (Ω) : aI L (Ω) I ∈ ∈ ∀ I ♦

87 88 CHAPTER 4. DIFFERENTIAL FORMS AND HOMOLOGY OF DISCRETE FUNCTIONS

Definition 4.5. The exterior derivative operator denoted by d is a map d :Λk(Ω) Λk+1(Ω), → defined as follows. Let I := i1, . . . , ik denote an increasing sequence of k indices (ij < ij+1) and let dxI = dxi dxi . P { } 1 ∧· · ·∧ k Given ω = I aI dxI define

X X ∂aI dω := daI dxI where daI := dxi. (4.1) ∧ ∂xi I i∈I ♦ We note that d commutes with pullbacks (that is, df ∗ω = f ∗dω) and that if ω is a k-form and θ is any form, d(ω θ) = dω θ + ( 1)kω dθ. ∧ ∧ − ∧ The exterior derivative plays a prominent role in Stokes’ Theorem, which we now state. Theorem 4.6. (Stokes) Given a compact, oriented n-dimensional manifold Ω with boundary ∂Ω and a smooth (n 1) form ω on Ω, the following equality holds: − Z Z ω = dω. ∂Ω Ω Stokes’ Theorem provides an alternative definition for the exterior derivative. Definition 4.7. (Alternative Definition) Let ω be a k-form on a compact oriented n-manifold Ω (0 k < n). The exterior derivative of ω is the unique (k + 1)-form dω such that on any (k + 1)-dimensional submanifold Π ≤Ω the following equality ⊂ holds: Z Z dω = ω. Π ∂Π ♦ It can be shown that dω is well-defined in this way by proving the existence and uniqueness of the d map via the definition (4.1). We note that this definition will motivate the discrete exterior derivative in Definition 4.13. Definition 4.8. The continuous Hodge star maps between forms of complementary and orthogonal dimensions, i.e. :Λk ∗ ∗ → Λn−k. For domains in R3 as considered here, is defined by the equations ∗ dx1 = dx2dx3, dx2 = dx1dx3, dx3 = dx1dx2, ∗ ∗ − ∗ 1 = dx1dx2dx3, = 1, ∗ ∗∗ 1 where dx1, dx2, dx3 is an orthonormal basis for Λ (Ω). { } ♦ 4.2 deRham Cohomology

4.3 k-forms and k-cochains 4.3.1 Discrete Differential Forms

Definition 4.9. Let K be a primal mesh of a compact n-manifold Ω. Let Kk denote the k-simplices of K.A primal k-chain c is a linear combination of the elements of Kk: X c = cσσ,

σ∈Kk where cσ R. The set of all such chains form the vector space of primal k-chains, denoted k. It has dimension k , equal ∈ C |C | to the number of elements of Kk.A k-chain c is represented as a column vector of length k . Similarly, a dual k-chain is a linear combination of k-cells of the dual complex ?K.|C The| vector space of dual k-chains is denoted k. C ♦ 4.3. K-FORMS AND K-COCHAINS 89

Definition 4.10. A primal k-cochain W is a linear functional on primal k-chains, i.e.

W : k R via c W(c), C → 7→ where W is a linear mapping. It is represented as a column vector of length k so that the action of W on a k-chain c is the |C | matrix multiplication WT c, yielding the scalar W(c). The space of primal cochains is denoted k. C A dual k-cochain W is a linear functional on dual k-chains, i.e.

W : k R via c W(c), C → 7→ k where W is a linear mapping. The space of dual cochains is denoted . C ♦ Cochains are the discrete analogues of differential forms as they can be evaluated over k-dimensional subspaces. To make this precise, we define the integration of a cochain over a chain to be the evaluation of the cochain as a function.

Definition 4.11. The integral of a primal k-cochain W over a primal k-chain c is defined to be Z W := WT c = W(c). c Hence, the integration of W over c is exactly the same as the evaluation of W on c. ♦

4.3.2 Discrete Exterior Derivative The definition of a discrete exterior derivative is motivated by the alternative definition of the continuous operator (Defini- tion 4.7). First we define the boundary operator in the discrete case.

Definition 4.12. The kth boundary operator denoted by ∂k takes a primal k-chain to its primal (k 1)-chain boundary. It is defined by its action on an oriented k-simplex: −

k X i ∂k[v0, v1, , vk] := ( 1) [v0, , vi, , vk] ··· − ··· b ··· i=0 where vi indicates that vi is omitted. The primal boundary operator is represented as a matrix of size k−1 k so that the b |C | × |C | action of ∂k on a k-chain c is the usual matrix multiplication ∂kc. ♦ Definition 4.13. The kth discrete exterior derivative of a primal k-cochain W is the transpose of the (k + 1)st boundary operator: T Dk = ∂k+1.

This is also referred to in the literature as the coboundary operator. It is represented as a matrix of size k+1 k so that T |C | × |C | the action of Dk on a primal k-cochain W is the usual matrix multiplication Dk W := ∂k+1W. ♦ The discrete exterior derivative satisfies the discrete version of Stokes’ theorem.

Lemma 4.14. Let W be a primal k-cochain and c k+1 any primal (k + 1)-chain. Then ∈ C Z Z Dk W = W. c ∂k+1c Proof. By Definition 4.11 we see that Z Z T T T T W = W ∂k+1c = (∂k+1W) c = (Dk W) c = Dk W. ∂k+1c c

We now consider the analogous constructions for dual cochains. Observe that mesh duality allows us to view a dual k- T chain c as a primal (n k)-chain c. Hence ∂n−k+1 serves as a boundary operator on dual k-cochains, giving us the following definition. − T Definition 4.15. The kth discrete exterior derivative of a dual k-cochain W is Dn−k−1, which is equal to ∂n−k. It is repre- sented as a matrix of size k+1 k . |C | × |C | ♦ 90 CHAPTER 4. DIFFERENTIAL FORMS AND HOMOLOGY OF DISCRETE FUNCTIONS

4.4 Types of k-form Finite Elements 4.4.1 Nédélec Elements The original Nédélec paper [136] introduced what is now called the H(curl) and H(div) Nédélec elements of the first kind. Phrased in the notation of this document, Nédélec defines

k k Yp−1 := SpΛp−1

3 where Sp Pep is defined for domains embedded in R by ⊂

Sp := f Pep :(x1, x2, x3) f = 0 . { ∈ · } He uses the formal definition of finite elements given below.

Definition 4.16. A finite element is a triple (K,P ,A) where

K is a domain • P is a space of polynomials on K of dimension N • A is a set of N linear functionals acting on P called degrees of freedom • His H(curl) finite element of degree p from [136] is defined as follows. Set

K to be a tetrahedron • P to be Pp−1 Sp • ⊕ A to be the following linear functionals acting on an element u Pp • ∈ Z 1 (u ~e) q ds, q Pk−1 e · ∀ ∈ where ~e is the unit vector directed along the edge e of K; Z 2 2 (u nˆ q) dγ, q (Pk−2) f × · ∀ ∈ where f is a face of K and u nˆ denotes the normal trace of u; Z × 3 3 u q dx; q (Pk−3) K · ∀ ∈ Note that this does not say what the basis functions should be - this was left to future work. The Whitney functions are an example of lowest order Nédélec elements. The H(div) finite element of degree p from [136] is similar. Set

K to be a tetrahedron • 1 P to be Pp−1 Pep(x1, x2, x3) • ⊕ A to be the following linear functionals acting on an element u Pp • ∈ Z 1. (u nˆ) q dγ, q Pk−1 f · ∀ ∈ where f is a face of K; Z 3 2. u q dx; q (Pk−2) K · ∀ ∈ Similarly, description of the basis functions was left to future work.

1 p The space Pep(x1, x2, x3) is called D in his work. It is the space of vectors formed by scaling (x1, x2, x3) by a homogeneous degree p polynomial. 4.4. TYPES OF K-FORM FINITE ELEMENTS 91

4.4.2 Whitney Elements

Let λi be the barycentric function associated to vertex vi in a primal mesh K. More precisely, λi : K R is the unique → function which is linear on each simplex of K satisfying λi(vj) = δij. The Whitney function σk associated to the k-simplex k W σ := [v0,..., vk] is given by k X i k := k! ( 1) λi dλ0 ... dλci ... dλk (4.2) Wσ − ∧ ∧ ∧ ∧ i=0 0 1 where dλci indicates that dλi is omitted. Note that dλ should be interpreted as d λ per Definition ?? or as ( λ) per ∇ Lemma ??. ♦ We write out the Whitney functions explicitly for n = 3, our primary application context. Note that 3 is the constant Wσ k k σ k Wσ 0 [v0] λ0

1 [v0, v1] λ0 λ1 λ1 λ0 ∇ − ∇ 2 [v0, v1, v2] 2(w0 w1 w2 w1 w0 w2 + w2 w0 w1) ∇ × ∇ − ∇ × ∇ ∇ × ∇ 3 3 [v0, v1, v2, v3] 1/ σ | |

Table 4.1: Whitney forms Wσk for n = 3. function with value 1/ σ3 . This is a consequence of the geometric identity | | 1 λi ( λj λk) = ∇ · ∇ × ∇ ±3! σ3 | | where the right side has sign 1 if an odd index was omitted from the scalar triple product and +1 otherwise. This reduces the 3 P − 3 sum in (4.2) to (1/ σ ) λi, which is simply 1/ σ due to the partition of unity formed by the barycentric functions. | | i | | Whitney Element Example

v2

v0 v1

On the standard reference triangle shown above, the Whitney 0-forms are the barycentric functions:

λ0 = x y + 1 − − λ1 = x

λ2 = y

The Whitney 1-forms are formed by taking products of the form λi λj λj λi: ∇ − ∇ 1 y 01 = λ0 λ1 λ1 λ0 = − W ∇ − ∇ x  y  02 = λ0 λ2 λ2 λ0 = W ∇ − ∇ 1 x −  y 12 = λ1 λ2 λ2 λ1 = − W ∇ − ∇ x 92 CHAPTER 4. DIFFERENTIAL FORMS AND HOMOLOGY OF DISCRETE FUNCTIONS

4.5 Biological Applications 4.5.1 Solving Poisson’s Equation and other PDEs from Biology Summary References and Further Reading

Although Whitney functions were developed out of theoretical considerations [181], it was recognized by Bossavit [42] that they provided a natural means for constructing stable bases for finite element methods, especially the edge elements and face elements that were gaining popularity at that time. Finite element exterior calculus (FEEC) [12] gives a full account of the analogies between spaces of Whitney functions and classical Nédélec [136, 137] and Raviart and Thomas [145] spaces. Some work has explored the possibility of Whitney functions over non-simplicial elements as we do in this work. Gradinaru and Hiptmair defined Whitney-like functions on rectangular grids using Haar-wavelet approximations [91] and on square-base pyramids by considering the collapse of a cube to a pyramid [92]. Bossavit has given an approach to Whitney forms over standard finite element shapes (hexahedra, triangular prisms, etc.) based on extrusion and conation arguments [40].

Exercises Chapter 5

Numerical Integration, Linear Systems

5.1 Numerical Quadrature 5.2 Collocation 5.3 Fast Multipole 5.4 Biological Applications 5.4.1 Efficient Computation of Molecular Energetics 5.4.2 PB and GB Energy Calculation Summary References and Further Reading Exercises

93 94 CHAPTER 5. NUMERICAL INTEGRATION, LINEAR SYSTEMS Chapter 6

Transforms

6.1 Radon Transform and its inverse discrete and continuous formulations

6.2 Fourier Transforms and its inverse discrete and continuous formulations Fast Fourier Transforms (FFT) via wrapped convolutions

6.3 Fast Approximate Summations using approximate FFT (irregular / non-equispaced FFT)

6.4 Biological Applications 6.4.1 Fast Computation of Molecular Energetics Summary References and Further Reading Exercises

95 96 CHAPTER 6. TRANSFORMS Chapter 7

Groups, Tilings, and Packings

7.1 Crystal Symmetries 7.1.1 Symmetries 7.1.2 Quasi-symmetries 7.2 Hexagonal Tilings 7.2.1 Caspar-Klug coordinate system 7.2.2 T-numbers 7.2.3 P-numbers 7.3 Icosahedral Packings 7.4 Biological Applications 7.4.1 Crystal Structures 7.4.2 Viral Capsid Symmetry Detection and Classification 7.4.3 Characterization of Large Deformations in Molecules Summary References and Further Reading Exercises

97 98 CHAPTER 7. GROUPS, TILINGS, AND PACKINGS Chapter 8

Motion Groups, Sampling

8.1 Rotation Group 8.2 Fourier Transforms 8.3 Sampling 8.3.1 Uniform 8.3.2 Non-uniform 8.4 Biological Applications 8.4.1 Docking Problem 8.4.2 Flexible Fitting Summary References and Further Reading Exercises

99 100 CHAPTER 8. MOTION GROUPS, SAMPLING Chapter 9

Optimization

9.1 Combinatorial 9.2 Geometric 9.2.1 Linear Programs 9.2.2 Quadratic Programs 9.2.3 Convex 9.2.4 Non-Convex 9.3 Biological Applications 9.3.1 Fast Computation Methods Summary References and Further Reading Exercises

101 102 CHAPTER 9. OPTIMIZATION Chapter 10

Statistics

10.1 Classical 10.2 Bayesian 10.3 Biological Applications Summary References and Further Reading Exercises

103 104 CHAPTER 10. STATISTICS Biology Appendix

105 106 CHAPTER 10. STATISTICS Conclusions

Something to conclude

107 108 CHAPTER 10. STATISTICS Bibliography

[1] S. Abhyankar. Algebraic space curves. Gaetan Morin Editeur Ltee, 1971. [2] S. Abhyankar. Desingularization of plane curves. Singularities, 40(Part 1):1, 1983. [3] S. Abhyankar. Good points of a hypersurface. Advances in Mathematics, 68(2):87–256, 1988. [4] S. Abhyankar. Algebraic geometry for scientists and engineers. Math. Surveys and Monographs, 35, 1990. [5] S. Abhyankar and C. Bajaj. Automatic Parameterization of Rational Curves and Surfaces II: Cubics and Conicoids. Computer Aided Design, 19,9:499–502, 1987. [6] S. S. Abhyankar and C. L. Bajaj. Automatic parameterization of rational curves and surfaces III: algebraic plane curves. Comput. Aided Geom. Des., 5(4):309–321, 1988. [7] R. Abraham, J. E. Marsden, and T. Ratiu. Manifolds, tensor analysis, and applications, volume 75 of Applied Mathe- matical Sciences. Springer-Verlag, New York, second edition, 1988. [8] A. Aho and J. Hopcroft. Design & Analysis of Computer Algorithms. Pearson Education India, 1974. [9] N. Akkiraju and H. Edelsbrunner. Triangulating the surface of a molecule. Discrete Applied Mathematics, 71(1-3):5–22, 1996. [10] G. Albers and T. Roos. Voronoi diagrams of moving points in higher dimensional spaces. In Proc. 3rd Scand. Workshop Algorithm Theory, volume 621 of Lecture Notes in Computer Science, pages 399–409. Springer-Verlag, 1992. [11] M. A. Armstrong. Basic Topolgy. Springer, New York, 1983. [12] D. Arnold, R. Falk, and R. Winther. Finite element exterior calculus: from Hodge theory to numerical stability. Bulletin of the American Mathematical Society, 47(2):281–354, 2010. [13] F. Aurenhammer. Voronoi diagrams: A survey of a fundamental geometric data structure. ACM Computing Surveys, 23:345–405, 1991. [14] C. Bajaj. Geometric Modeling with Algebraic Surfaces. In D. Handscomb, editor, The Mathematics of Surfaces III, pages 3–48. Oxford Univ. Press, 1988. [15] C. Bajaj. Geometric modeling with algebraic surfaces. In D. Handscomb, editor, The Mathematics of Surfaces III, pages 3–48. Oxford Univ. Press, 1988. [16] C. Bajaj. Geometric computations with algebraic varieties of bounded degree. In Proc. of the Sixth ACM Symposium on Computational Geometry, pages 148–156, Berkeley, California, 1990. [17] C. Bajaj. Rational hypersurface display. ACM SIGGRAPH Computer Graphics, 24(2):117–127, 1990. [18] C. Bajaj. The Emergence of Algebraic Curves and Surfaces in Geometric Design. In R. Martin, editor, Directions in Geometric Computing. Information Geometers Press, United Kingdom, 1992. [19] C. Bajaj. The Emergence of Algebraic Curves and Surfaces in Geometric Design. In R. Martin, editor, Directions in Geometric Computing, pages 1–29. Information Geometers Press, 1993.

109 110 BIBLIOGRAPHY

[20] C. Bajaj, F. Bernardini, and G. Xu. Automatic reconstruction of surfaces and scalar fields from 3D scans. In ACM SIGGRAPH, pages 109–118, 1995. [21] C. Bajaj and W. J. Bouma. Dynamic Voronoi diagrams and Delaunay triangulations. In Proceedings of the 2nd Canadian Conference on Computational Geometry, pages 273–277, 1990. [22] C. Bajaj, J. Chen, and G. Xu. Free form Surface Design with A-Patches. In Proceedings of Graphics Interface’94, pages 174–181, Banff, Canada., 1994. [23] C. Bajaj, J. Chen, and G. Xu. Modeling with Cubic A-Patches. ACM Transactions on Graphics, 14, 2:103–133, 1995. [24] C. Bajaj, T. Garrity, and J. Warren. On the applications of multi-equational resultants. COMP TR88-83, Department of Computer Science, Rice University, 1988. [25] C. Bajaj and S. Goswami. Automatic fold and structural motif elucidation from 3d em maps of macromolecules. In ICVGIP 2006, pages 264–275, 2006. [26] C. Bajaj, C. Hoffmann, R. Lynch, and J. Hopcroft. Tracing surface intersections. Computer aided geometric design, 5(4):285–307, 1988. [27] C. Bajaj and I. Ihm. Algebraic surface design with Hermite interpolation. ACM Transactions on Graphics, 11(1):61–91, January 1992. [28] C. Bajaj and I. Ihm. Lower Degree Approximation of Surfaces for Revolved Objects. Technical Report 92-084, Computer Sci., Purdue Univ., November 1992. [29] C. Bajaj and I. Ihm. Smoothing polyhedra using implicit algebraic splines. SIGGRAPH’92, Computer Graphics, 26(2):79–88, July 1992. [30] C. Bajaj, H. Y. Lee, R. Merkert, and V. Pascucci. NURBS based B-rep models for macromolecules and their properties. In Proceedings of the 4th ACM Symposium on Solid Modeling and Applications, pages 217–228, New York, NY, USA, 1997. ACM. [31] C. Bajaj, V. Pascucci, A. Shamir, R. Holt, and A. Netravali. Multiresolution molecular shapes. Technical report, TICAM, Univ. of Texas at Austin, Dec. 1999. [32] C. Bajaj, V. Pascucci, A. Shamir, R. Holt, and A. Netravali. Dynamic maintenance and visualization of molecular surfaces. Discrete Applied Mathematics, 127(1):23–51, 2003. [33] C. Bajaj and A. Royappa. A note on an efficient implementation of the Sylvester resultant for multivariate polynomials. Computer Science Technical Report CSD-TR-718, Purdue University, 1988. [34] C. Bajaj and A. Royappa. The ganith algebraic geometry toolkit. In Lecture Notes in Computer Science, volume 429, pages 268–26, 1990. [35] C. Bajaj, G. Xu, and Q. Zhang. A fast variational method for the construction of resolution adaptive c2-smooth molecular surfaces. Computer Methods in Applied Mechanics and Engineering, 198(21-26):1684–1690, 2009. [36] N. Basdevant, D. Borgis, and T. Ha-Duong. A coarse-grained protein-protein potential derived from an all-atom force field. Journal of Physical Chemistry B, 111(31):9390–9399, 2007. [37] M. Behzad and G. Chartrand. Introduction to the theory of graphs. Allyn and Bacon Inc., Boston, Mass., 1971. [38] J. F. Blinn. A generalization of algebraic surface drawing. ACM Transactions on Graphics, 1(3):235–256, July 1982. [39] W. Blythe. On Models of Cubic Surfaces, 1905. [40] A. I. Bobenko. Delaunay triangulations of polyhedral surfaces, a discrete laplace-beltrami operator and applications. In SCG ’08: Proceedings of the twenty-fourth annual symposium on Computational geometry, pages 38–38, New York, NY, USA, 2008. BIBLIOGRAPHY 111

[41] F. Bookstein. Fitting conic sections to scattered data. Computer Graphics and Image Processing, 9:56–71, 1979. [42] A. Bossavit. Whitney forms: a class of finite elements for three-dimensional computations in electromagnetism. Proc. of the IEEE, 135(8):493–500, 1988. [43] Y. Bourne, J. Grassi, P. E. Bougis, and P. Marchot. Conformational flexibility of the acetylcholinesterase tetramer suggested by x-ray crystallography. Journal of Biological Chemistry, 274(43):30370–30376, 1999. [44] Y. Bourne, P. Taylor, and P. Marchot. Acetylcholinesterase inhibition by fasciculin: crystal structure of the complex. Cell, 83:503, 1995. [45] B. Buchberger. Gröbner-bases: An algorithmic method in polynomial ideal theory, 1985. [46] J. Canny. The Complexity of Robot Motion Planning, 1988. [47] J. Canny. Generalised characteristic polynomials. Journal of Symbolic Computation, 9(3):241–250, 1990. [48] J. Canny, E. Kaltofen, and L. Yagati. Solving systems of nonlinear polynomial equations faster. In Proceedings of the ACM-SIGSAM 1989 international symposium on Symbolic and algebraic computation, pages 121–128. ACM, 1989. [49] F. Cazals, F. Chazal, and T. Lewiner. Molecular shape analysis based upon the morse-smale complex and the connolly function. In 19th Ann. ACM Sympos. Comp. Geom., pages 351–360, 2003. [50] R. Chaine. A geometric convection approach of 3D reconstruction. In Proc. Eurographics Sympos. on Geometry Pro- cessing, pages 218–229, 2003. [51] G. Chartrand and L. Lesniak. Graphs & digraphs. Chapman & Hall/CRC, Boca Raton, FL, fourth edition, 2005. [52] F. Chazal and A. Lieutier. Stability and homotopy of a subset of the medial axis. In Proc. 9th ACM Sympos. Solid Modeling and Applications, pages 243–248, 2004. [53] L. P. Chew. Constrained Delaunay triangulations. In Proc. 3rd Annual ACM Symposium Computational Geometry, pages 215–222, 1987.

[54] P. Chew. Near-quadratic bounds for the L1 Voronoi diagram of moving points. Computational Geometry Theory and Applications, 7, 1997. [55] A. Chistov and D. Grigoryev. Subexponential-time solving of systems of algebraic equations I. Steklov institute, LOMI preprint E-9-83, 1983. [56] Cocone. Tight Cocone Software for surface reconstruction and medial axis approximation. http://www.cse.ohio- state.edu/ tamaldey/cocone.html, 2001. ∼ [57] M. Connolly. Solvent-accessible surfaces of proteins and nucleic acids. Science, 221(4612):709–713, 19 August 1983. [58] M. L. Connolly. Analytical molecular surface calculation. Journal of Applied Crystallography, 16:548–558, 1983. [59] CVC, UT Austin. Volrover. http://cvcweb.ices.utexas.edu/software/guides.php, 2011. [60] M. de Berg and K. T. G. Dobrindt. On levels of detail in terrains. Graphical Models and Image Processing, 60:1–12, 1998. [61] A. DeRose. Geometric Continuity : A Parametrization Independent Measure of Continuity for Computer Aided Geomet- ric Design. PhD thesis, Computer Science, Univ. of California, Berkeley, 1985. [62] M. Desbrun and M. Gascuel. Animating soft substances with implicit surfaces. In R. Cook, editor, SIGGRAPH 95 Conference Proceedings, Annual Conference Series, pages 287–290, Los Angeles, August 1995. Addison Wesley. [63] T. K. Dey, J. Giesen, and S. Goswami. Shape segmentation and matching with flow discretization. In F. Dehne, J.-R. Sack, and M. Smid, editors, Proc. Workshop Algorithms Data Strucutres (WADS 03), LNCS 2748, pages 25–36, Berlin, Germany, 2003. 112 BIBLIOGRAPHY

[64] M. Eck, T. DeRose, T. Duchamp, T. Hoppe, H. Lounsbery, and W. Stuetzle. Multiresolution analysis of arbitrary meshes. In ACM Computer Graphics Proceedings, SIGGRAPH’95, pages 173–180, 1995. [65] H. Edelsbrunner. Weighted alpha shapes. Technical Report 1760, University of Illinois at Urbana-Champaign, 1992. [66] H. Edelsbrunner. Surface reconstruction by wrapping finite point sets in space. In B. Aronov, S. Basu, J. Pach, and M. Sharir, editors, Ricky Pollack and Eli Goodman Festschrift, pages 379–404. Springer-Verlag, 2002. [67] H. Edelsbrunner, M. Facello, and J. Liang. On the definition and the construction of pockets in macromolecules. Tech Report UIUCDCS-R-95-1935, University of Illinois Urbana-Champaign, 1995. [68] H. Edelsbrunner, J. Harer, V. Natarajan, and A. Zomorodian. Morse-smale complexes for piecewise linear 3-manifolds. In 19th Ann. Sympos. Comp. Geom., pages 361–370, 2003. [69] H. Edelsbrunner, J. Harer, and A. Zomorodian. Hierarchical morse-smale complexes for piecewise linear 2-manifolds. Discrete Computational Geometry, 30:87–107, 2003. [70] H. Edelsbrunner and E. P. Mücke. Three-dimensional alpha shapes. ACM Transactions on Graphics, 13(1):43–72, 1994. [71] H. Edelsbrunner and N. R. Shah. Incremental topological flipping works for regular triangulations. Algorithmica, 15:223–241, 1996. [72] E. Eyal and D. Halperin. Dynamic maintenance of molecular surfaces under conformational changes. In SCG ’05: Proceedings of the 21st Annual Symposium on Computational Geometry, pages 45–54, 2005. [73] E. Eyal and D. Halperin. Improved maintenance of molecular surfaces using dynamic graph connectivity. Algorithms in Bioinformatics, pages 401–413, 2005. [74] M. A. Facello. Geometric Techniques for Molecular Shape Analysis. PhD thesis, University of Illinois, 1996. Department of Computer Science Technical Report # 1967. [75] P. Fj "allstr "om. Smoothing of polyhedral models. In Proceedings of the second annual symposium on Computational geometry, page 235. ACM, 1986. [76] J. J. Fu and R. C. T. Lee. Voronoi diagrams of moving points in the plane. International Journal of Computational Geometry Applications, 1(1):23–32, 1991. [77] T. Fujita, K. Hirota, and K. Murakami. Representation of splashing water using metaball model. Fujitsu, 41(2):159–165, 1990. in Japanese. [78] W. Fulton and W. Fulton. Intersection theory. Springer, 1984. [79] M. Garland. QSlim. http://graphics.cs.uiuc.edu/ garland/software/qslim.html, 2004. [80] M. Garland and P. Heckbert. Simplifying surfaces with color and texture using quadric error metrics. In IEEE Visualiza- tion, pages 263–270, 1998. [81] T. Garrity and J. Warren. On computing the intersection of a pair of algebraic surfaces. Computer Aided Geometric Design, 6(2):153, 1989. [82] T. Garrity and J. Warren. Geometric Continuity. CAGD, 8:51 – 65, 1991. [83] P. Giblin. Graphs, surfaces and homology. Cambridge University Press, Cambridge, third edition, 2010. [84] T. S. Gieng, B. Hamann, K. I. Joy, G. L. Schussman, and I. J. Trotts. Constructing hierarchies for triangle meshes. IEEE Transactions on Visualization and Computer Graphics, 4(2):145–161, 1998. [85] J. Giesen and M. John. The flow complex: a data structure for geometric modeling. In Proc. 14th ACM-SIAM Sympos. Discrete Algorithms, pages 285–294, 2003. BIBLIOGRAPHY 113

[86] M. Giusti. Some effectivity problems in polynomial ideal theory. EUROSAM 84, pages 159–171, 1984. [87] G. Golub. Some modified matrix eigenvalue problems. SIAM Review, 15(2):318–334, 1973. [88] G. Golub and R. Underwood. Stationary values of the ratio of quadratic forms subject to linear constraints. Z. Agnew. Math. Phys., 21:318–326, 1970. [89] G. Golub and C. Van Loan. Matrix Computation. The Johns Hopkins Univ. Press, Baltimore, MD, 1983. [90] S. Goswami, T. K. Dey, and C. L. Bajaj. Identifying flat and tubular regions of a shape by unstable manifolds. In Proc. 11th ACM Sympos. Solid and Phys. Modeling, pages 27–37, 2006. [91] V. Gradinaru. Whitney elements on sparse grids. PhD thesis, Universität Tübingen, 2002. [92] V. Gradinaru and R. Hiptmair. Whitney elements on pyramids. Electronic Transactions on Numerical Analysis, 8:154– 168, 1999. [93] R. L. Graham and P. Hell. On the history of the minimum spanning tree problem. Ann. Hist. Comput., 7(1):43–57, 1985. [94] J. Grant and B. Pickup. A gaussian description of molecular shape. Journal of Physical Chemistry, 99:3503–3510, 1995. [95] G. Graves. The magic of metaballs. Computer Graphics World, 16(5):27–32, 1993. [96] X. Gu and S.-T. Yau. Global conformal surface parameterization. In SGP ’03: Proceedings of the 2003 Eurograph- ics/ACM SIGGRAPH symposium on Geometry processing, pages 127–137, Aire-la-Ville, Switzerland, Switzerland, 2003. Eurographics Association. [97] L. Guibas, J. S. B. Mitchell, and T. Roos. Voronoi diagrams of moving points in the plane. In Proceedings of the 17th Internatational Workshop on Graph-Theoretical Concepts in Computer Science, volume 570 of Lecture Notes in Computer Science, pages 113–125. Springer-Verlag, 1991. [98] V. Guillemin and A. Pollack. Differential Topology. Prentice-Hall, Inc., Englewood Cliffs, New Jersey, 1974. [99] B. Guo. Modeling Arbitrary Smooth Objects with Algebraic Surfaces. PhD thesis, Computer Science, Cornell University, 1991. [100] R. Hartshorne. Algebraic geometry. springer Verlag, 1977. [101] A. Henderson. The Twenty Seven Lines upon the Cubic Surface, 1911. [102] K. Hensel. Theorie der Algebraischen Zahlen. Teubner, 1908. [103] I. Herstein. Topics in algebra. Wiley and Sons, 1975. [104] R. Hiptmair. Finite elements in computational electromagnetism. Acta Numerica, pages 237–339, 2002. [105] A. N. Hirani. Discrete Exterior Calculus. PhD thesis, California Institute of Technology, 2003. [106] C. Ho and C. Yap. Polynomial Remainder Sequences and Theory of Subresultants. Technical report, Technical Report, 1987. [107] C. Hoffmann and J. Hopcroft. The potential method for blending surfaces and corners. Technical report, Cornell University, 1985. [108] C. Hoffmann and J. Hopcroft. Quadratic blending surfaces. Computer-Aided Design, 18(6):301–306, 1986. [109] M. Holst, N. Baker, and F. Wang. Adaptive multilevel finite element solution of the poisson-boltzmann equation i: Algorithms and examples. Journal of Compututational Chemistry, 21:1319–1342, 2000. [110] J. Hopcroft and D. Krafft. The challenge of robotics for computer science. Advances in Robotics, 1:7–42, 1987. [111] H. Hoppe. Progressive meshes. In ACM Computer Graphics Proceedings, SIGGRAPH’96, pages 99–108, 1996. 114 BIBLIOGRAPHY

[112] P. H. Hubbard. Collision Detection for Interactive Graphics Applications. PhD thesis, Department of Computer Science, Brown University, Providence, Rhode Island, April 1995. [113] P. M. Hubbard. Approximating polyhedra with spheres for time-critical collision detection. ACM Transactions on Graphics, 15(3), 1996. [114] I. Ihm. On Surface Design with Implicit Algebraic Surfaces. PhD thesis, Purdue University, August 1991. [115] H. Imai, M. Iri, and K. Murota. Voronoi diagram in the laguerre geometry and its applications. SIAM J. Comput., 14:93–10, 1985. [116] T. Ju, F. Losasso, S. Schaefer, and J. Warren. Dual contouring of hermite data. In SIGGRAPH, pages 339–346, 2002. [117] A. Khodakovsky, N. Litke, and P. Schroder. Globally smooth parameterizations with low distortion. ACM Transactions on Graphics, 22(3):350–357, 2003. [118] R. Klein and J. Kramer. Multiresolution representations for surface meshes. In Proceedings of the SCCG, 1997. [119] J. B. Kruskal, Jr. On the shortest spanning subtree of a graph and the traveling salesman problem. Proc. Amer. Math. Soc., 7:48–50, 1956. [120] S. Kumar, D. Manocha, and A. Lastra. Interactive display of large-scale NURBS models. IEEE Transactions on Visual- ization and Computer Graphics, 2(4):323–336, 1996. [121] E. Kunz. Introduction to Commutative Algebra and Algebraic Geometry. Birkhauser, New York, 1985. [122] M. Lee, M. Feig, F. Salsbury, and C. Brooks. New analytic approximation to standard molecular volume definition and its application to generalized born calculation. Journal of Computational Chemistry, 24:1348–1356, 2003. [123] M. Levitt, C. Sander, and P. S. Stern. Protein normal-mode dynamics: Trypsin inhibitor, crambin, ribonuclease and lysozyme. Journal of Molecular Biology, 181:423 – 447, 1985. [124] S. Lodha and J. Warren. Bézier Representaion for Cubic Surface Patches. Computer Aided Design, 24(12):643 – 650, 1992. [125] R. Loos. Generalized Polynomial Remainder Sequences, 1983. [126] F. Macaulay. Some formulae in elimination. Proceedings of the London Mathematical Society, 1(1):3, 1902. [127] F. Macaulay and P. Roberts. The algebraic theory of modular systems. Cambridge Univ Pr, 1994. [128] A. Maheshwari, P. Morin, and J. R. Sack. Progressive tins: Algorithms and applications. In Proceedings 5th ACM Workshop on Advances in Geographic Information Systems, Las Vegas, 1997. [129] N. L. Max. Computer representation of molecular surfaces. IEEE Computer Graphics and Applications, 3(5):21–29, August 1983. [130] E. Mayr and A. Meyer. The complexity of the word problems for commutative semigroups and polynomial ideals* 1. Advances in Mathematics, 46(3):305–329, 1982. [131] A. Middleditch and K. Sears. Blend surfaces for set theoretic volume modelling systems. In Proceedings of the 12th annual conference on Computer graphics and interactive techniques, page 170. ACM, 1985. [132] J. Milnor. Morse Theory. Princeton University Press, New Jersey, 1963. [133] F. Mora and H. M "oller. The computation of the Hilbert function. Computer Algebra, pages 157–167, 1983. [134] L. J. Mordell. Diophantine equations. Pure and Applied Mathematics, Vol. 30. Academic Press, London, 1969. [135] J. R. Munkres. Elements of algebraic topology. Addison-Wesley Publishing Company, Menlo Park, CA, 1984. BIBLIOGRAPHY 115

[136] J.-C. Nédélec. Mixed finite elements in R3. Numer. Math., 35(3):315–341, 1980. [137] J.-C. Nédélec. A new family of mixed finite elements in R3. Numer. Math., 50(1):57–81, 1986. [138] I. Newton. The Mathematical Papers of Issac Newton. Cambridge University Press, 1680. [139] H. Nishimura, M. Hirai, T. Kawai, T. Kawata, I. Shirakawa, and K. Omura. Object modeling by distribution function and a method of image generation. Transactions IECE Japan, Part D, J68-D(4):718–725, 1985. [140] T. Nishita and E. Nakamae. A method for displaying metaballs by using Bézier clipping. In Computer Graphics Forum, volume 13, pages 271–280. Eurographics, Basil Blackwell Ltd, 1994. Eurographics ’94 Conference issue. [141] J. Owen and A. Rockwood. Blending surfaces in solid geometric modeling. Geometric Modeling: Algorithms and New Trends, pages 347–366, 1987. [142] H. Padé. Sur la générlisation des fractions continues algébriques. Jour. de Math., 4(10):291–329, 1894. [143] V. Pan. Fast and efficient algorithms for sequential and parallel evaluation of polynomial zeros and of matrix polynomials. In 26th Annual Symposium on Foundations of Computer Science, 1984., pages 522–531, 1985. [144] V. Pratt. Direct least-squares fitting of algebraic surfaces. ACM SIGGRAPH Computer Graphics, 21(4):145–152, 1987. [145] P.-A. Raviart and J. M. Thomas. A mixed finite element method for 2nd order elliptic problems. In Mathematical aspects of finite element methods (Proc. Conf., Consiglio Naz. delle Ricerche (C.N.R.), Rome, 1975), pages 292–315. Lecture Notes in Math., Vol. 606. Springer, Berlin, 1977. [146] J. Renegar. On the worst-case arithmetic complexity of approximating zeros of systems of polynomials. SIAM Journal on Computing, 18:350, 1989. [147] J. Renegar. On the computational complexity and geometry of the first-order theory of the reals. Part I: Introduction. Preliminaries. The geometry of semi-algebraic sets. The decision problem for the existential theory of the reals. Journal of symbolic computation, 13(3):255–299, 1992. [148] T. Roos. Vorono˘ı diagrams over dynamic scenes. Discrete Applied Mathematics. Combinatorial Algorithms, Optimiza- tion and Computer Science, 43(3):243–259, 1993. [149] T. Roos. New upper bounds on Voronoi diagrams of moving points. Nordic Journal of Computing, 4(2):167–171, 1997. [150] K. Rosen. Discrete mathematics and its applications. McGraw-Hill, 2003. [151] J. Rossignac and P. Borrel. Multi-resolution 3d approximation for rendering complex scenes. In B. Falcidieno and T. Kunii, editors, Geometric Modeling in Computer Graphics, pages 455–465. Springer-Verlag, 1993. [152] J. Rossignac and A. Requicha. Constant-radius blending in solid modeling. Computers in Mechanical Engineering, 3(1):65–73, 1984. [153] G. Salmon. Lessons introductory to the modern higher algebra. Hodges, Figgis, and co., 1885. [154] G. Salmon. A Treatise on the Analytic Geometry of Three Dimensions, vol. I and II, 1914. [155] P. Sampson. Fitting conic sections to very scattered data : An iterative refinement of the bookstein algorithm. Computer Graphics and Image Processing, 18:97–108, 1982. [156] M. Sanner, A. Olson, and J. Spehner. Fast and robust computation of molecular surfaces. In Proceedings of the eleventh annual symposium on Computational geometry, pages 406–407. ACM Press, 1995. [157] M. Sanner, A. Olson, and J. Spehner. Reduced surface: an efficient way to compute molecular surfaces. Biopolymers, 38(3):305–320, March 1996. [158] M. F. Sanner and A. J. Olson. Real time surface reconstruction for moving molecular fragments. In Proceedings of the Pacific Symposium on Biocomputing ’97, Maui, Hawaii, January 1997. 116 BIBLIOGRAPHY

[159] R. Sarraga. G1 interpolation of generally unrestricted cubic Bézier curves. Computer Aided Geometric Design, 4(1- 2):23–39, 1987.

[160] J. Schreiner, A. Asirvatham, E. Praun, and H. Hoppe. Inter-surface mapping. In ACM Transactions on Graphics (TOG), volume 23, pages 870–877. ACM, 2004.

[161] W. J. Schroeder. A topology modifying progressive decimation algorithm. In R. Yagel and H. Hagen, editors, IEEE Visualization ’97, pages 205–212. IEEE, nov 1997.

[162] J. Schwartz. Fast probabilistic algorithms for verification of polynomial identities. Journal of the ACM (JACM), 27(4):717, 1980.

[163] T. Sederberg. Piecewise algebraic surface patches. Computer Aided Geometric Design, 2:53–59, 1985.

[164] T. Sederberg. Piecewise algebraic surface patches. CAGD, 2(1-3):53–59, 1985.

[165] T. Sederberg and J. Snively. Parametrization of cubic algebraic surfaces. In R. R. Martin, editor, Mathematics of Surfaces II, pages 299–310. Clarendon Press, Oxford, 1987.

[166] J. Semple and L. Roth. Introduction to Algebraic Geometry. Oxford University Press, Oxford, U.K., 1949.

[167] A. Sheffer, E. Praun, and K. Rose. Mesh parameterization methods and their applications. Foundations and Trends R in Computer Graphics and Vision, 2(2):105–171, 2006.

[168] D. Siersma. Voronoi diagrams and morse theory of the distance function. In O. E. Barndorff and E. B. V. Jensen, editors, Geometry in Present Day Science, pages 187–208. World Scientific, 1999.

[169] Y. Song, Y. Zhang, C. Bajaj, and N. Baker. Continuum diffusion reaction rate calculations of wild type and mutant mouse acetylcholinesterase: Adaptive finite element analysis. Biophysical Journal, 87(3):1558–1566, 2004.

[170] Y. Song, Y. Zhang, T. Shen, C. Bajaj, J. McCammon, and N. Baker. Finite element solution of the steady-state smolu- chowski equation for rate constant calculations. Biophysical Journal, 86(4):2017–2029, 2004.

[171] O. G. Staadt and M. H. Gross. Progressive tetrahedralizations. In Proceddings of the IEEE Visualization Conference, pages 397–402, 1998.

[172] G. Strang. Linear Algebra and its Applications. Harcourt Brace Jovanovich, San Diego, third edition, 1988.

[173] F. Tama. Normal mode analysis with simplified models to investigate the global dynamics of biological systems. Protein and Peptide Letters, 10(2):119 – 132, 2003.

[174] A. Varshney and F. Brooks. Fast analytical computation of richards’s smooth molecular surface. In VIS ’93: Proceedings of the 4th conference on Visualization ’93, pages 300–307, 1993.

[175] R. Voorintholt, M. T. Kosters, G. Vegter, G. Vriend, and W. G. Hol. A very fast program for visualizing protein surfaces, channels and cavities. Journal of Molecular Graphics, 7(4):243–245, December 1989.

[176] R. Walker. Algebraic Curves. Springer Verlag, New York, 1978.

[177] R. Walker. Algebraic Curves. Springer Verlag, New York, 1978.

[178] J. Warren. On algebraic surfaces meeting with geometric continuity. PhD thesis, Cornell University, 1986.

[179] J. Warren. Blending quadric surfaces with quadric and cubic surfaces. In Proceedings of the third annual symposium on Computational geometry, pages 341–347. ACM, 1987.

[180] K. Weierstrass. Vorbereitungssatz. In Einige auf die Theorie der Analytischen Funktionen Mehrerer Veranderlichen sich Beziehende, pages 135–188, 1860.

[181] H. Whitney. Geometric Integration Theory. Princeton University Press, 1957. BIBLIOGRAPHY 117

[182] J. B. with C. Bajaj, J. Blinn, M.-P. Cani-Gascuel, A. Rockwood, B. Wyvill, and G. Wyvill, editors. Introduction to Implicit Surfaces. Morgan Kaufmann Publishers, San Francisco, 1997. [183] J. Woodwark. Blends in geometric modelling. In Proceedings on Mathematics of surfaces II, page 297. Clarendon Press, 1987.

[184] J. Woodwark. Blends in geometric modelling. In R. Martin, editor, The Mathematics of Surfaces, volume 2, pages 255–297. Oxford University Press, 1987. [185] B. Wyvill, C. McPheeters, and G. Wyvill. Animating soft objects. The Visual Computer, 2(4):235–242, 1986. [186] B. Wyvill, C. McPheeters, and G. Wyvill. Data structure for soft objects. The Visual Computer, 2(4):227–234, 1986.

[187] S. Yoshimoto. Ballerinas generated by a personal computer. Journal of Visualization and Computer Animation, 3(2):55– 90, 1992. [188] T. You and D. Bashford. An analytical algorithm for the rapid determination of the solvent accessibility of points in a three-dimensional lattice around a solute molecule. Journal of Computational Chemistry, 16(6):743–757, 1995. [189] Z. Yu and C. Bajaj. A segmentation-free approach for skeletonization of gray-scale images via anisotropic vector dif- fusion. Computer Vision and Pattern Recognition, 2004. CVPR 2004. Proceedings of the 2004 IEEE Computer Society Conference on, 1:I–415–I–420 Vol.1, 2004. [190] O. Zariski and P. Samuel. Commutative Algebra (Vol. I, II), 1958. [191] D. Zhang, J. Suen, Y. Zhang, Y. Song, Z. Radic, P. Taylor, M. Holst, C. Bajaj, N. Baker, and J. McCammon. Tetrameric mouse acetylcholinesterase: Continuum diffusion rate calculations by solving the steady-state smoluchowski equation using finite element methods. Biophysical Journal, 88(3):1659–1665, 2004. [192] Y. Zhang, C. Bajaj, and B.-S. Sohn. Adaptive and quality 3d meshing from imaging data. In ACM Solid Modeling and Applications, pages 286–291, 2003. [193] Y. Zhang, C. Bajaj, and B.-S. Sohn. 3d finite element meshing from imaging data. Special issue of Computer Methods in Applied Mechanics and Engineering on Unstructured Mesh Generation, in press, 2004. [194] W. Zhao, G. Xu, and C. Bajaj. An algebraic spline model of molecular surfaces. In SPM ’07: Proceedings of the 2007 ACM symposium on Solid and physical modeling, pages 297–302, 2007. [195] A. J. Zomorodian. Topology for computing, volume 16 of Cambridge Monographs on Applied and Computational Mathematics. Cambridge University Press, Cambridge, 2009.