by

Claus A. Andersson and Søren B. Engelsen

From this page you can download the MATLAB source-code used in the paper **The mean hydration of carbohydrates as studied by normalized 2-D radial pair distributions,** Claus A. Andersson and Søren B. Engelsen, Journal of Molecular Graphics and Modeling, **17** (2), 101-105 & 131-133 (1999)

The routine takes as input the location of the centerpoint of the two spheres and the two said spheres' radii and calculates the rotational common volume used for normalizing the density maps of the atoms under investigation. Feel free to contact the authors via e-mail.

twosphv2.m (3.2 KB) |
Calculates the volume of intersection of the two spheres given their distance, radii and shell thickness. |

Type '`help twosphv2`

' in the MATLAB Command Window to get help on the parameters.

by Claus A. Andersson

We observe two atoms, A and B, connected through their centres by a virtual axis. The centre of atom A defines the origo of the axis, and on this axis the distance between the atoms is *R*. Two spheres circumscribe atom A, the innermost with radius *r _{Ai}* and the outermost with radius

Figure 1: Two oxygen atoms. The common shell volume is found by estimating the area of the greenish area and rotating it 2 around the common axis. |
Figure 2: Same as Figure 1 with examples on the notation. |

The task of calculating the volume of a sphere, limited by two planes perpendicular to its radius, is a significant subproblem in this regard. Let *x*_{1} define the intersection point of the first limiting plane and let *x*_{2} define the intersection point of the second plane on the axis common to both atoms. Initially, an expression is derived for a sphere circumscribing atom B, which has its centre located at *R*. For atom A, the same solution applies for *R=0*.

Using the nomenclature above, and as depicted in Figure 2, the solution is as described in **(1)** subject to

$ \left( x_1, x_2, r, R \in \mathbb{R} \mid x_1 < x_2 \wedge \{x_1, x_2\} \in \{R - r, R + r\} \right) $

\begin{eqnarray} V\left(x_1, x_2, r, R\right) & = & \pi\int_{x_1}^{x_2}y\left(x,r,R\right)^2dx \\ & = & \pi\int_{x_1}^{x_2} r^2-\left(x-R\right)^2 dx \bf(1) \\ & = & \frac{\pi}{3}\left(x_1^3 - x_2^3\right) + \pi R\left(x_2^2 - x_1^2\right) + \pi\left(x_2 - x_1\right)\left(r^2 - R^2 \right) \end{eqnarray}

Given *V,* the problem simplifies to identify *x _{1}* and

**Case I** $ \left( R - r_{Bi} \le - r_{Ao} \right) : $

$$ V^I = 0 $$

**Case II** $ \left( - r_{Ao} < R - r_{Bi} \le - r_{Ai} \right) : $

$$ V^{II} = V\left(- r_{Ai}, I\left(A_o, B_i\right),r_{Ao},0\right) - V\left(R - r_{Bi}, I\left(A_o, B_i\right), r_{Bi}, R\right) $$

**Case III** $ \left( - r_{Ai} < R - r_{Bi} \le r_{Ai} \right) : $

\begin{eqnarray} V^{III} & = & V\left(R - r_{Bo}, I\left(A_o,B_o\right),r_{Bo},R\right) + V\left( I\left(A_o,B_o\right), I\left(A_o,B_i\right), r_{Ao}, 0\right)\\ & & - V\left(- r_{Ai}, I\left(A_i, B_i\right), r_{Ai}, 0\right) - V\left( I\left(A_i, B_i\right), I\left(A_o, B_i\right), r_{Bi}, R\right) \end{eqnarray}

**Case IV** $ \left( - r_{Ai} < R - r_{Bo} < R - r_{Bi} \le r_{Ai} \right) : $

\begin{eqnarray} V^{IV} & = & V\left( I\left(A_i, B_o\right), I\left(A_o, B_o\right), r_{Bo}, R\right) + V\left( I\left(A_o, B_o\right), I\left(A_o, B_i\right), r_{Ao}, 0\right) \\ & & - V\left( I\left(A_i, B_o\right), I\left(A_i, B_i\right), r_{Ai}, 0\right) - V\left( I\left(A_i, B_i\right), I\left(A_o, B_i\right), r_{Bi}, R\right) \end{eqnarray}

**Case V** $ \left( r_{Ai} < R - r_{Bi} < r_{Ao} \right) : $

\begin{eqnarray} V^{V} & = & V\left( I\left(A_i, B_o\right), I\left(A_o, B_o\right), r_{Bo}, R\right) + V\left( I\left(A_o,B_o\right), I\left( A_o, B_i\right), r_{Ao}, 0\right) \\ & & - V\left( I\left(A_i, B_o\right), r_{Ai}, r_{Ai}, 0\right) - V\left( R - r_{Bi}, I\left(A_o, B_i\right), r_Bi, R\right) \end{eqnarray}

**Case VI** $ \left( r_{Ai} \le R - r_{Bo} < r_{Ao} \right) : $

$$ V^{VI} = V( R - r_{Bo}, I(A_o, B_o), r_{Bo}, R) + V( I(A_o, B_o), r_{Ao},r_{Ao},0) $$

**Case VII** $ \left( r_{Ao} \le R - r_{Bo} \right) : $

$$ V^{VII} = 0 $$