The Weighted Mean Curvature Derivative of a Space-Filling Diagram

Representing an atom by a solid sphere in $3$-dimensional Euclidean space, we get the space-filling diagram of a molecule by taking the union. Molecular dynamics simulates its motion subject to bonds and other forces, including the solvation free energy. The morphometric approach [HRC13,RHK06] writes the latter as a linear combination of weighted versions of the volume, area, mean curvature, and Gaussian curvature of the space-filling diagram. We give a formula for the derivative of the weighted mean curvature. Together with the derivatives of the weighted volume in [EdKo03], the weighted area in [BEKL04], and the weighted Gaussian curvature [AkEd19], this yields the derivative of the morphometric expression of the solvation free energy.


Introduction
This paper makes a significant step toward realizing the morphometric idea of modeling the solvation free energy in molecular dynamics. We recall that molecular dynamics uses Newton's second law of motion to simulate the dynamic behavior of molecules. We focus on the case in which the motion is computed within an implicit solvent model, in which the effect of water is captured by an effective solvation potential, W = W elec + W np . The first term on the right-hand side accounts for the electrostatic polarization, and the second term for the van der Waals interactions and the formation of a void in the solvent. Referring to a large body of work on W elec [15], we focus on the non-polar or hydrophobic effect of water, namely W np . In an effort to quantify this effect, Lee and Richards introduced the solvent-accessible surface of a molecule [12]. It is the boundary of the space-filling diagram in which each atom is represented by a ball whose radius is its van der Waals radius plus 1.4 Angstrom for the approximate radius of a water molecule. Based on this concept, Eisenberg and McLachlan defined the solvation free energy as a weighted sum of the surface area, W np = i w i A i , in which w i is the atomic solvation parameter and A i is the area of the sphere modeling the i-th atom that is accessible to the solvent [9]. There is, however, disagreement about the precise formulation fueled in part by evidence that for a small solute, W np is more closely related to the solvent-excluded volume rather than the solvent-accessible area [13,16]. To resolve this controversy, the morphometric approach of Roth and coauthors [11,14] suggests that W np be a linear combination of the intrinsic volumes, which in R 3 are the volume, area, mean curvature, and Gaussian curvature. This approach is inspired by the mathematical theory of intrinsic volumes, which we now summarize.
To begin, we let K ⊆ R 3 be a compact convex body and write K r = K ⊕ rB 3 for the parallel body obtained by thickening K by r all around. As proved by Jakob Steiner, the volume of the parallel body is described by a degree-3 polynomial, Volume(K r ) = a 0 + a 1 r + a 2 r 2 + a 3 r 3 , in which a 0 , a 1 , a 2 , and a 3 are the volume, surface area, mean curvature, and one third of the Gaussian curvature of K [17]. Scaled and re-indexed versions of the coefficients are referred to as the intrinsic volumes of K. According to Hugo Hadwiger's characterization theorem, every measure of K that is invariant under rigid motions, continuous, and additive is a linear combination of the intrinsic volumes [10]. Since the solvent-accessible model is obtained by thickening the van der Waals model, the analogy seems compelling, except that molecules are generally not convex. To bridge this gap, we mention a result by Morgan Crofton, which states that the i-th coefficient of the Steiner polynomial satisfies in which c 0 = 1, c 1 = 2 π , c 2 = 1, c 3 = 4π 3 [4]. To explain (2), we note that G 3 i is the Grassmannian that consists of all i-planes passing through the origin in R 3 , H is such an i-plane, x is a point on the orthogonal (3 − i)-plane, H + x is the i-plane parallel to H that passes through x, and χ is the Euler characteristic. Importantly, Crofton's integral formula (2) is not restricted to convex bodies and can thus be used to extend the definition of intrinsic volume to non-convex bodies. Returning to the modeling of molecules, we embrace the morphometric approach. In other words, we write W np = µ 0 · a 0 + µ 1 · a 1 + µ 2 · a 2 + µ 3 · a 3 , in which the a i are the volume, area, mean curvature, and one third of the Gaussian curvature of the solvent-accessible model, and physical meanings of the µ i can be found in [11,14]. To model physical properties, such as hydrophobicity, we consider weighted versions of the four measures. To embed this approach into molecular dynamics software, we need the derivative of W np with respect to the motion or, equivalently, the derivatives of the weighted volume, the weighted area, the weighted mean curvature, and the weighted Gaussian curvature. The first two of those derivatives have been studied in [7] and [3], where we find formulas based on the Voronoi decomposition of the space-filling diagram as well as characterizations of the configurations at which the derivative is not continuous. The main result of this paper is a similar analysis of the weighted mean curvature derivative, and we refer to [1] for the last piece of the puzzle, which is the weighted Gaussian curvature derivative.
Outline. Section 2 reviews the background relevant to this paper. Section 3 derives the constituents of the weighted mean curvature of a space-filling diagram. Section 4 states the derivative in terms of the gradient. Section 5 analyzes the configurations at which the gradient is not continuous. Section 6 concludes this paper.

Background
The background needed for the technical results reported in this paper include two classic theorems in geometry attributed to Archimedes and to Heron of Alexandria, the concept of a space-filling diagram to represent a molecule, the corresponding alpha complex to do the book-keeping, and the analysis of the weighted volume and weighted area derivatives, which are heavily based on these concepts.
Two area formulas. Write S 2 for the unit sphere in R 3 and recall that its area is 4π. Accordingly, the area of a sphere with radius r is 4πr 2 . Spheres in R 3 enjoy a property discovered thousands of years ago by Archimedes, which is unique to three dimensions. To describe it, we use Cartesian coordinates and let f : S 2 → R map every point to its third coordinate, which we call its height. By Archimedes, the area of the cap consisting of all points at height at most −1 ≤ a ≤ 1 depends linearly on a and is therefore 4π times 1 + a divided by the diameter of the unit sphere, which is 2.
A slice of the sphere can be written as the preimage of an interval, [a, b] . We note that the area of the slice thus depends on the width, b − a, but is independent of the location of the interval within [−1, 1]. A formula that gives the area of a triangle in terms of the lengths of the three edges is attributed to Heron of Alexandria, although it has been suggested that Archimedes knew about the formula two centuries earlier.

Formula 2 (Heron's Theorem). The area of a triangle with edges of length a, b, c is
There are various proofs of this formula and a number of equivalent statements. We will use Space-filling diagrams. Mathematically, such a diagram is merely the union of finitely many closed balls in R 3 . Its significance derives from the use as geometric model of biomolecules [12], such as proteins, DNA, and the like. This section introduces the concept along with most of the notation needed for its discussion in the technical sections.
Throughout this paper, we assume a set of n closed balls in R 3 , X = {B i | 0 ≤ i < n}, in which x i ∈ R 3 is the center and r i ∈ R is the radius of B i . The space-filling diagram is the union of these balls, X = n−1 i=0 B i . We are interested in the volume, area, mean curvature, Gaussian curvature of this diagram. The volume should be clear. To describe the other three measures, we note that the boundary of X consists of patches of spheres that remain after we remove open caps, S i \ j =i int B j , in which S i = bd B i . These patches meet along portions of circles that remain after we remove open arcs, S ij \ k =i,j int B k , in which S ij = S i ∩ S j . These portions of circles consist of closed arcs that meet at corners of the form S ijk \ =i,j,k int B , in which S ijk = S i ∩ S j ∩ S k . For ease of reference, we summarize and extend the introduced notation in Table 2, which is given in the appendix. The area is simply the sum of areas of the sphere patches. The mean curvature is more subtle because the boundary of the space-filling diagram is not a smooth surface. Instead of defining it as an integral of the point-wise mean curvature, we use a discrete formula according to which the contribution of an arc in the boundary of X is its length times the dihedral angle between the outward normals of the two spheres that share the arc; see (7) for the formula in the weighted case. Similarly, we write the Gaussian curvature as a sum of contributions of sphere patches, circular arcs, and corners; see (8) for the formula in the weighted case. Alternatively, we can make use of the Gauss-Bonnet theorem according to which the Gaussian curvature is 2π times the Euler characteristic of the surface, but no such shortcut is available for the weighted case, which we discuss next.

Voronoi decomposition and dual alpha complex.
To generalize the measures to the weighted case, we introduce the Voronoi decomposition of the space-filling diagram and its dual, the alpha complex, which serves as a book-keeping device.
Recall that X is a set of n closed balls B i with centers x i and radii r i . The power distance of a point a ∈ R 3 from B i is π i (a) = a − x i 2 − r 2 i , and we note that a) for 0 ≤ j < n}, and we write V ij , V ijk , and V ijk for the pair-wise, triple-wise, and quadruple-wise intersections. The Voronoi domains decompose the space-filling diagram into convex sets of the type B i ∩ V i . We will need notation for the fraction of the ball represented by this set, and similarly for the fractions of common intersections, which we collect in Table 2, which is given in the appendix. Letting w i ∈ R be the weight of the i-th closed ball, the formulas for the weighted measures of a space-filling diagram are given in (5), (6), (7), and (8) below.
The fractional measures listed in Table 2 are conveniently computed using the alpha complex of X, which is the nerve of the sets B i ∩ V i [8]. Recall that the Delaunay mosaic is the nerve of the sets V i , which implies that the alpha complex is a subcomplex of the Delaunay mosaic, and generically, both are simplicial complexes realized in R 3 . It will be convenient to denote a simplex by the set of indices of its vertices, or by the sequence if we need an ordered version of the simplex. By alpha shape we mean the underlying space of the alpha complex. To explain the connection between the simplices and the measures, we note that a tetrahedron ijk in the Delaunay mosaic belongs to the alpha complex iff ν ijk > 0, and the same rule applies to the triangles, edges, and vertices of the mosaic. Furthermore, a triangle ijk in the alpha complex belongs to the boundary of the alpha shape iff σ ijk > 0, and the same rule applies to the edges and vertices of the complex. To compute these fractions, we use inclusion-exclusion over subsets of simplices in the alpha complex. For example, in which the sums are over all edges, triangles, tetrahedra in the alpha complex that share x i as a vertex. Proofs and additional formulas can be found in [5].

Weighted intrinsic volume.
Recall that X is the union of the balls B i , for 0 ≤ i < n. Its state, x ∈ R 3n , is the concatenation of the center vectors. In other words, the (3i + )-th coordinate of x is the -th coordinate of x i . We use the Voronoi tessellation to divide the space-filling diagram into individual contributions and get the weighted intrinsic volume by multiplication with the corresponding weight.
Proposition 3 (Weighted Intrinsic Volumes). The weighted volume, surface area, mean curvature, and Gaussian curvature of the space-filling diagram, X, are To get the above formula for the mean curvature, we smoothen the crevices of the space-filling diagram by rolling a ball of radius ε > 0 about the surface. For sufficiently small ε, the resulting surface is everywhere differentiable, and we take the limit of its total mean curvature as ε goes to zero. Along circular arcs, we partition the mean curvature in equal parts to the two intersecting spheres. The rationale for this rule is that the surface swept out by the centers of the rolling balls of different radii partitions the exterior dihedral angle at the arc in equal parts. Using the same geometric intuition, we partition the contribution of a corner of the space-filling diagram to the Gaussian curvature in proportions α i + α j + α k = 1; see [1] for details. All variables have been defined above, except for φ ij (the angle between the unit normals of the spheres at a point of S ij = S i ∩ S j ), λ ij (the combined length of the two normals after projection to the line passing through x i and x j ), and φ ijk (the solid angle spanned by the unit normals of S i , S j , S k at a point of common intersection, P ∈ S ijk ).

Weighted volume and area derivatives.
To state the derivative of the weighted volume, we introduce the momentum, t ∈ R 3n , which is the concatenation of the velocity vectors. In other words, the vector t i = [t 3i+1 , t 3i+2 , t 3i+3 ] T is the velocity vector of the i-th ball. The derivative of a function F : R 3n → R can be given in terms of the gradient: DF [7] gives the derivative of the weighted volume: in which U ij is the vector from x ij to the centroid of B ij ∩ V ij , and the sum is over all edges in the alpha complex that are incident to x i .
Writing a = ∇ x area and a i = [a 3i+1 , a 3i+2 , a 3i+3 ] T , [3] gives the derivative of the weighted area: Proposition 5 (Gradient of Weighted Area). The derivative of the weighted area of the space-filling diagram at state x with momentum t is Darea x (t) = a, t with in which the first sum is over the boundary edges in the alpha complex incident to x i , and the second sum is over the triangles incident to these edges.

Derivatives
We recall (7) and decompose the weighted mean curvature function into a first term, which accounts for the curvature within the sphere patches, and a second term, which accounts for the curvature concentrated along the circular arcs: While not reflected in the notation, σ i , r ij , φ ij , and σ ij depend on the state. It is convenient to write σ i (τ ) for σ i at state x + τ t, and similarly for the other functions. Furthermore, we write σ i for the derivative of σ i at τ = 0, and similarly we write r ij , φ ij , σ ij . Derivatives with respect to parameters other than τ are explicitly stated as such.

Derivative of σ i
To derive σ i , we follow [3] and decompose the motion into a direction preserving component and a distance preserving component. The direction preserving motion stretches the distance between two centers, while the distance preserving motion rotates one center about the other. We therefore write in which × is the cross or outer product that maps vectors a and b to the vector c = a × b of length a b sin ∠ab normal to both in such a way that the sequence a, b, c forms a right-handed system in space; see Figure 1. The analysis of the direction preserving motion Figure 1 The angular momentum of the motion of xj relative to xi. Projecting tj − ti onto the tangent vector of the circular orbit, we get a system of pairwise orthogonal vectors, t rot j , uij, and ωj.
is similar to the analysis of the area derivative in [3], and we repeat the main steps for completeness. Since little in terms of a proof of the distance preserving motion is offered in [3], we give a complete argument, which can be translated back almost verbatim to a proof in the area case.
Direction preserving motions. Consider two balls, B i and B j , and the change of surface area under a motion of x i that preserves the direction, u ij . Let x i − x j = ξ i + ξ j , in which the terms on the right-hand side of the equation are the signed distances from the centers to the plane bisector. As noted in [3], we have and similarly for ξ j . Plugging (17) into Formula 1, we get Differentiating with respect to the distance between the two centers, we get the rate of area change, which happens right next to the circle of intersection. In the general case, the cap B j ∩ S i may overlap with other caps so that only a fraction of the bounding circle belongs to the boundary of the space-filling diagram. Accordingly, the derivative is the same fraction of the derivative without any such overlap: Multiplying the right-hand side of (19) with t j − t i , u ji , we get the derivative with respect to the direction preserving motion of x j , and taking the sum over all j = i, we get the derivative of σ i with respect to the direction preserving motions of all x j ; compare with the first sum on the right-hand side of (21) in Lemma 6.
Distance preserving motions. Consider first the case of a single cap, B j ∩ S i . The rotation defined by ω j keeps the cap as well as σ i at constant size. This is because S i loses area along the front of the circle that bounds the cap, it gains area along the back of this circle, and the loss equals the gain. In the more general case depicted in Figure 2, it is possible that the loss and the gain no longer cancel each other. N S Figure 2 Blue sphere, Si, with cap, Bj ∩ Si, in the middle moving due west. We shade the relevant part, which is the cap clipped to within the Voronoi domain of xj. The motion divides its boundary into the front part (on the left) and the back part (on the right). Area loss and gain happen along the circular arcs bounding the clipped cap. The dotted caps surrounding Bj ∩ Si are of the form B k ∩ Si, and their vectors u ijk are all orthogonal to the edge connecting xi with xj.
To calculate the net loss or gain, we let N and S be antipodal points on S i , which we refer to as north-and south-pole, such that the cap center lies on the equator -the great-circle halfway between N and S -and the motion follows the equator. We recall that t rot j is the velocity vector of x j , and r i / x i − x j times t rot j is the velocity vector of the cap center. In Figure 2, we draw NS vertical, we place x j and the cap center on top of x i , and we let the velocity vector go horizontally from right to left. By Formula 1, the area loss along an arc of the front does not depend on its position but only on the length of its projection onto NS. We are interested in arcs of S ij that lie on the boundary of the space-filling diagram, and we compute the net loss or gain indirectly, by measuring the projections of the edges in the Voronoi tessellation defined by B i , B j , and a third ball, B k . Recall that B ijk is the line segment that connects the two points in which S i , S j , S k meet, and that ν ijk is the fraction of this line segment that belongs to the Voronoi decomposition of the space-filling diagram. If this edge belongs to the front of the clipped cap, then its contribution is positive because it subtracts from the loss along the front. Symmetrically, if the edge belongs to the back of the clipped cap, then its contribution is negative. To quantify, we recall the definition of u ijk given in Table 2. The signed fraction of the projection of the relevant portion of B ijk onto NS is its length, 2r ijk ν ijk , times the cosine of the projection angle, t rot j , u ijk / t rot j , divided by the diameter of the sphere, 2r i . By Formula 1, this is also the area fraction of the corresponding strip around the sphere. Dividing by the length of the circular orbit, 2π x i − x j , we get the derivative: in which we write ∠x i x j for the angle that parametrizes the rotation of x j . We get the contribution to σ i by multiplying with t rot j and observing that t rot j , u ijk = t j − t i , u ijk for all k; compare with the second sum on the right-hand side of (21) in Lemma 6.

Summary.
A clipped cap whose entire boundary consists of straight line segments does not touch the boundary of the space-filling diagram and therefore has no contribution to the derivative. These caps correspond to interior edges of the alpha complex. Omitting them from the sum, we get the derivative of σ i .
Lemma 6 (Derivative of σ i ). The derivative of the fraction of S i on the boundary of the space-filling diagram at state x with momentum t is in which first sum is over the boundary edges of the alpha complex incident to x i , with coefficient given in (19), and the second sum is over the triangles incident to these edges.

Derivatives of r ij and of φ ij
Recall that r ij is the radius of the circle S ij = S i ∩ S j , assuming the two spheres have a non-empty intersection. As illustrated in Figure 3, it is also the height of the triangle with base of length x i − x j and edges of length r i and r j . The area of the triangle is Alternatively, we can compute the area using the version of the Heron formula given right after Formula 2: The derivative of the area with respect to the distance between the two centers is x i x j φ ij r ij Figure 3 The radius of the circle, rij, in which the two spheres intersect is the height of the triangle whose base connects the centers of the spheres. Extending the two edges to the outward normals of the two spheres, we get the angle, φij, that is relevant in our computations.
From this, we get the derivative of the height of the triangle: Switching our attention, we observe that the angle between the outward normals, φ ij , is also the angle opposite the base inside the triangle in Figure 3. Recall that the Law of Cosines generalizes Pythagoras' Theorem beyond right-angled triangles: c 2 = a 2 + b 2 − 2ab cos γ, in which a, b, c are the lengths of the sides and γ is the angle opposite to the side of length c. In our application, we have a = r i , b = r j , c = x i − x j , and γ = φ ij . Hence, Recall that the derivative of arccos x is −1/ √ 1 − x 2 . Together with the chain rule for differentiation, this gives the derivative of the angle with respect to the length of the base: We summarize the results of this subsection for later reference.
Lemma 7 (Derivatives of r ij and of φ ij ). The derivatives of the radius of the intersection circle of two spheres and of the angle between the outward normals at the intersection at state x with momentum t are with the coefficients in the two equations given in (27) and (30).

Derivative of σ ij
Recall that σ ij is the fraction of the circle S ij = S i ∩ S j that belongs to the space-filling diagram. We compute its derivative under the motion t in several steps, the first of which modifies the motion. Without altering the derivative, we do this such that the center and the plane of the circle are fixed.
Modifying the motion. We begin by fixing x i in space, which we do by changing the velocity vector of x j to t j − t i for every j, as before. Next, we fix the normal direction of the plane that contains S ij by removing the angular momentum. Specifically, we change the velocity vector of in which ω j is given in (16); see Figure 1. After this modification, the point x j moves with speed v along u ji , in which v is the length of the new velocity vector. Accordingly, we change the velocity vector of for every k, and note that V iji = 0 and V ijj = V ij . We finally fix the plane of the circle. To this end, we recall that ξ i and ξ j given in (17) are the signed distances of x i and x j from the plane of S ij . We have ξ i + ξ j = x i − x j and use them to write the center of the circle as an affine combination of the centers of the spheres: Suppose now that x i is fixed and x j moves with speed v in the direction of u ji . To compute the speed of x ij moving in the same direction, we set x i = 0, write x j = x i − x j , and simplify (33) we write D for the derivative in this special, 1-dimensional scenario, and note that x ij moves with speed Dv. Subtracting the corresponding multiple of u ji from the velocity vector of every point x k , we get the final collection of vectors.

Lemma 8 (Change of Motion).
Replacing the velocity vector t k by T ijk = V ijk − DV ij , for every k, fixes the center and the plane of the circle S ij = S i ∩ S j while preserving the derivative of σ ij . The coefficient of V ij is given in (34).
Movement of x k . The circle S ij alternates between the boundary and the interior of the space-filling diagram, and we are interested in the arcs that belong to the boundary. The endpoints of these arcs belong to 0-spheres of the form S ijk = S i ∩ S j ∩ S k . Recall that σ ijk is 0, 1 2 , or 1. If σ ijk = 1, then both points of S ijk lie on the boundary of the space-filling diagram and therefore serve as endpoints of the relevant arcs of S ij , if σ ijk = 1 2 , then only Figure 4 The sphere intersects the circle in two points, and we draw the tangent plane that touches the sphere in one of these points. The orthogonal projections of T ijk and of vu P ij onto x k − P give the speed v k .
one of the two points serves in this capacity, and if σ ijk = 0, then neither point serves in this capacity. Consider a sphere, S k , such that σ ijk = 1 2 or 1, and let P ∈ S ijk be an endpoint of an arc; see Figure 4. We are interested in the speed in which the point P moves along S ij . To compute this speed, we let u P ij be the unit vector that is tangent to S ij at the point P such that x k and P + u P ij lie on the same side of the tangent plane, that is: and the correct sign is the one for which x k − P, u P ij > 0; see Figure 4. When x k moves along T ijk with speed T ijk , then the tangent plane moves along x k − P with speed v k = x k − P, T ijk / x k − P . At the same time, the tangent plane moves along u P ij with a speed v such that substituting vu P ij for T ijk in this equation gives the same speed, namely v k . In other words, v x k − P, u P ij = x k − P, T ijk and therefore v = x k − P, T ijk / x k − P, u P ij . This implies in which ∠x i x j x k is the angle parametrizing the circular motion of x k about the line passing through x i and x j , with k is such that P ∈ S ijk ; see the first sum on the right-hand side of (31) in Lemma 7.
Change of r ij . Recall that Lemma 7 gives the rate of change of the radius. We ask how it affects the derivative of σ ij . To begin, we observe that h k = x ij − P, x k − P / x k − P is the signed distance of x ij from the tangent plane. It is positive if x ij and x k lie on the same side of the plane, and negative if they lie on opposite sides. Letting α P be the angle between x ij − P and the line in which the tangent plane intersects the plane of S ij , we get h k = r ij sin α P . Hence, α P = arcsin(h k /r ij ), and we are interested in the derivative with respect to the radius. Remembering that the derivative of arcsin x is 1/ √ 1 − x 2 , we get dα P dr ij = 1 Using the chain rule, we get the derivative with respect to x i − x j by multiplying (37) with (27) and then taking the sum over all points P ; see the second sum on the right-hand side of (31) in Lemma 7.

Summary.
Adding the contribution of the changing radius to those of the movements of the x k and normalizing by the length of the circle, we get the desired derivative.
Lemma 9 (Derivative of σ ij ). The derivative of the fraction of S ij on the boundary of the space-filling diagram at state x with momentum t is in which the coefficients in the second sum are given in (37) and (27). Both sums are over all oriented boundary triangles of the alpha shape that share the edge from x i to x j , and P ∈ S ijk is the corresponding corner of the space-filling diagram.

Gradients
We write the derivative of the weighted mean curvature function, mean : R 3n → R, in terms of the gradient of mean at x ∈ R 3n , denoted m = ∇ x mean. Recalling (15), this derivative is Writing m = [m 1 , m 2 , . . . , m 3n ] T , we recall that m i = [m 3i+1 , m 3i+2 , m 3i+3 ] T is the 3dimensional gradient that applies to x i . Using boldface letters for the gradients of p, q, s, and similar conventions for the 3-dimensional sub-vectors, we have m = p + q + s and m i = p i + q i + s i for 0 ≤ i < n. We get the gradients by redistributing the derivatives stated in Lemmas 6 to 9.
First term. To begin, we use Lemma 6 to rewrite (39) as in which the first sum is over all directed boundary edges of the alpha shape, and the second sum is over all triangles incident to these edges. Observe that for fixed i, we get possibly non-zero contributions to all p j . Symmetrically, we get p i by accumulating contributions from all j. Using u ji = −u ij and u jik = u ijk , we get in which the first sum is over all boundary edges of the alpha shape incident to x i , and the second sum is over all triangles incident to these edges. Not surprisingly, the result is similar to the weighted area gradient given in Proposition 5. Specifically, we get a ij = p ij r i and a ijk = p ijk r i .
Second term. We use Lemma 7 to rewrite (40) as in which the sum is over all directed boundary edges of the alpha shape. Redistributing the terms, we get in which the sum is over all boundary edges of the alpha shape incident to x i .

Third term.
The redistribution of the pieces on the right-hand side of (38) to get the gradient is complicated by the change of the motion. We therefore begin by rewriting T ijk . To this end, we recall that the cross product is distributive: a×b+a×c = a×(b+c), and that the Lagrange formula turns a triple cross product into two scalar products: Recalling the definition of D from (34), we can now rewrite the new motion vector: in which the third line is obtained by applying the Lagrange formula and writing We need the scalar product of T ijk with x k − P : in which We are now ready to rewrite (41) using Lemma 9 as in which the sum is over the three ordered versions of all oriented boundary triangles of the alpha shape. Letting i, j, k be the vertices of such a triangle, the ordered versions are given by the index triplets ijk, kij, jki, and we write P for the corresponding corner of the space-filling diagram, noting that P ∈ S ijk . Observe that an unordered triangle that belongs to 0, 1, 2 tetrahedra in the alpha complex occurs 2, 1, 0 times in this sum. Redistributing the terms, we get in which the sum is over all oriented boundary triangles of the alpha shape that share x i . As before, P ∈ S ijk is the corresponding corner of the space-filling diagram.

Summary.
We finally get the gradient of the weighted mean curvature function by adding the gradients of the three component functions: Theorem 10 (Gradient of Weighted Mean Curvature). The derivative of the weighted mean curvature of the space-filling diagram at state x with momentum t is Dmean x (t) = m, t , in which m i = p i + q i + s i as given in (45), (50), and (64), for all 0 ≤ i < n.

Violations of Continuity
To embed our formulas in the inner loop of a molecular dynamics application, the implementation must be efficient and robust. We address the latter requirement by identifying the subset of R 3n where the gradient of the weighted mean curvature function is not continuous. This subset is contained in the subset of non-generic states, which we describe first.
General position. We distinguish two types of degenerate states: where the Delaunay mosaic is ambiguous, and where the Delaunay mosaic is unambiguous but the alpha complex is ambiguous. Recall that X is a collection of n closed balls in R 3 , and that these balls can move individually but their radii are fixed. We say X is in general position and, equivalently, that its state is generic if the following three conditions hold: I. the common intersection of p + 1 Voronoi domains is either empty or a convex polyhedron of dimension 3 − p; II. the common intersection of p + 1 spheres bounding balls in X is either empty or a sphere of dimension 2 − p.
Condition I implies that any five Voronoi domains have an empty common intersection, and Condition II implies that any four spheres have an empty common intersection. Each violation of Condition I corresponds to a (3n − 1)-dimensional submanifold of R 3n and so does every violation of Condition II, except when two radii are the same, in which case we get a submanifold of dimension 3n − 3. Let M I and M II be the union of submanifolds that correspond to violations of Conditions I and II, respectively. Since there are only finitely many such submanifolds, M I and M II have dimension 3n − 1 each.
Condition I and flips. If Condition I is satisfied, then the Delaunay mosaic is simplicial. We get a violation when the state trajectory intersects M I . We limit ourselves to discussing what we call the typical case, in which there is only one violation of general position. Indeed, multiple violations correspond to intersections of the (3n − 1)-dimensional submanifolds. In the typical case, the intersection is an isolated point where the trajectory passes locally from one side of M I to the other. The corresponding change in the Delaunay mosaic is a flip, of which there are four types. For integers 1 ≤ b ≤ 4 and a = 5 − b, the b-to-a flip replaces b tetrahedra by a tetrahedra; see [6] for details on this operation. The Delaunay mosaic is a simplicial complex geometrically realized in R 3 , both before and after the replacement. This implies that the union of the b tetrahedra before the flip be the same as the union of the a tetrahedra after the flip.
To be more formal, let B be the complex consisting of the b tetrahedra and their faces, and let A be the complex consisting of the a tetrahedra and their faces. Then C = B ∩ A is the common boundary of both complexes, and the flip substitutes A \ C for B \ C in the Delaunay mosaic. By construction, either all simplices of B \ C and of A \ C belong to the alpha complex before and after the flip, or none does. In the latter case, none of the formulas in Theorem 10 are affected by the flip. In the former case, some terms in the formulas get replaced by other terms. At the moment of the flip, the replaced and the replacing terms evaluate to the same numerical value, which implies that the weighted mean curvature and its derivative are unchanged and therefore continuous. We can see this by noting that the flip does not alter the combinatorial structure of the space-filling diagram boundary and therefore affects neither the weighted mean curvature nor its derivative.
Condition II and critical simplices. Condition II addresses situations in which the alpha complex changes while the Delaunay mosaic stays the same: we either add one or more simplices in the mosaic to the complex or we remove them from the complex. Here we consider the case in which only one simplex is added or removed. With reference to the discrete Morse theory of Delaunay mosaics outlined in [2], we call this a critical simplex. We distinguish three cases.
Case C 1 : the added or removed simplex is an edge of the Delaunay mosaic. At the moment of the change, the spheres whose centers are the endpoints of the edge touch in a single point. Letting i and j be the indices of the spheres, ε = r i + r j − x i − x j is negative when the spheres are disjoint and positive when they intersect in a circle. For ε < 0, the edge does not belong to the alpha complex and therefore contributes neither to the weighted mean curvature nor to its gradient. For ε > 0, the change to the weighted mean curvature caused by the edge depends on the change in area of the space-filling diagram, the change in length of its arcs, and the dihedral angles at the arcs. Focussing on the rough order of the changes, it is not difficult to see that ∆area = ε, ∆length = √ ε, Angle = 1, and therefore ∆mean = √ ε and ∇mean = ∞ at ε = 0.
The other two cases are similar so we will be brief. In each case, we use ε to parameterize the local motion, with ε = 0 at the moment of change. We feel free to make further simplifying assumptions, such as the radii being distinct, the weights being positive, etc.
Case C 2 : the added or removed simplex is a triangle of the Delaunay mosaic. At the moment of change, the spheres whose centers are the vertices of the triangle meet in a single point. By easy analysis, we get ∆area = ε √ ε, ∆length = √ ε, Angle = 1, and therefore ∆mean = √ ε and ∇mean = ∞ at ε = 0. Case C 3 : the added or removed simplex is a tetrahedron of the Delaunay mosaic. At the moment of change, the spheres whose centers are the vertices of the tetrahedron meet in a single point. By easy analysis, we get ∆area = ε 2 , ∆length = ε, Angle = 1, and therefore ∆mean = ε and ∆ ∇mean = 1 at ε = 0.
In conclusion, the weighted mean curvature is continuous but its gradient occasionally changes discontinuously; see Table 1 for a convenient summary of the three cases above as well as the six cases to be discussed shortly. Table 1 The order of change of the weighted mean curvature and of its gradient at states that violate Condition II.

Condition II and non-singular intervals.
Here we consider the case in which at least two simplices are added or removed at the same moment. Generically, these simplices form an interval of size 2, 4, or 8; see [2] for details. We encounter six cases.
Case N 01 : A vertex together with an incident edge are added or removed. At the moment of change, the sphere centered at the vertex breaks through the surface of the sphere whose center is the other endpoint of the edge. By easy analysis, we get ∆area = ε, ∆length = √ ε, and because φ ij is proportional to r ij also Angle = √ ε. Hence ∆mean = ε and ∆ ∇mean = 1 at ε = 0. Case N 02 : A vertex together with an incident triangle and its two edges that share the vertex are added or removed. At the moment of change, the sphere centered at the vertex breaks through the circle at which the two spheres centered at the other vertices of the triangle intersect. By easy analysis, we get ∆area = ε √ ε, ∆length = √ ε, Angle = 1, and therefore ∆mean = √ ε and ∇mean = ∞ at ε = 0. Case N 03 : A vertex together with an incident tetrahedron and its three edges and three triangles that share the vertex are added or removed. At the moment of change, the sphere centered at the vertex breaks through the pair of points in which the three spheres centered at the other vertices of the tetrahedron intersect. We get ∆area = ε 2 , ∆length = ε, Angle = 1, and therefore ∆mean = ε and ∆ ∇mean = 1 at ε = 0. Case N 12 : An edge together with an incident triangle are added or removed. At the moment of change, the circle in which the two spheres centered at the endpoints of the edge intersect breaks through the surface of the sphere centered at the third vertex of the triangle. By easy analysis, we get ∆area = ε √ ε, ∆length = √ ε, Angle = 1, and therefore ∆mean = √ ε and ∇mean = ∞ at ε = 0. Case N 13 : An edge together with an incident tetrahedron and its two triangle that share the edge are added or removed. At the moment of change, the circle in which the two spheres centered at the endpoints of the edge intersect breaks through the circle in which the two spheres centered at the other vertices of the tetrahedron intersect. We get ∆area = ε 2 , ∆length = ε, Angle = 1, and therefore ∆mean = ε and ∆ ∇mean = 1 at ε = 0. Case N 23 : A triangle together with an incident tetrahedron are added or removed. At the moment of change, the pair of points in which the three spheres centered at the vertices of the triangle intersect break through the surface of the sphere centered at the fourth vertex of the tetrahedron. We get ∆area = ε 2 , ∆length = ε, Angle = 1, and therefore ∆mean = ε and ∆ ∇mean = 1 at ε = 0.
See again Table 1 for a convenient summary of the results in all cases. We note that the situation in the unweighted case has better continuity properties along M II ⊆ R 3n in some cases, but the analysis is more involved. Subtracting M I ∪ M II from R 3n , we are left with finitely many open cells such that the formula of the weighted mean curvature and of its derivative are both invariant over each cell. All terms in these formulas are continuous over the cell, which implies that both mean : R 3n → R and ∇mean : R 3n → R 3n are continuous over the open cell. As argued above, mean and ∇mean are also continuous at states x ∈ M I \ M II , hence they are continuous at all x ∈ R 3n \ M II . We summarize the findings of this section.
Theorem 11 (Continuity of Gradient). The gradient of the weighted mean curvature of a space-filling diagram of n closed balls in R 3 is continuous provided the state x ∈ R 3n of the diagram does not belong to M II , which is a (3n − 1)-dimensional subset of R 3n .

Discussion
The main contribution of this paper is the analysis of the derivative of the weighted mean curvature of the space-filling diagram of a set of moving balls. Specifically, we give an explicit description of the gradient of the weighted mean curvature function, which for n spheres is a map from R 3n to R. In addition, we characterize the subset of R 3n at which the derivative violates continuity. In total, this is sufficient information for an efficient and robust implementation of the weighted mean curvature derivative, one that can be added to the inner loop of a molecular dynamics simulation of a physical system. There are several questions about this application that go beyond the scope of this paper: Is there a connection between the coefficients with which the morphological approach combines the intrinsic volumes [11,14] and the states at which their gradients are not continuous? Splitting the mean curvature concentrated along an arc in equal parts is suggested by the Apollonius diagram of the spheres, but splitting it according to the Voronoi diagram is also feasible. Are there physical reasons to prefer one split over the other?
We remark that the formulas in this paper can be easily adapted to splitting the mean curvature according to the Voronoi tessellation of the spheres.

A Notation
Si = bd Bi sphere bounding ball Sij = bd Bij circle bounding disk S ijk = bd B ijk pair of points bounding line segment xi, xij, x ijk centers of Si, Sij, S ijk ri, rij, r ijk radii of Si, Sij, S ijk uij =