# Thread: Relative Coordinates in 3D

1. ## Relative Coordinates in 3D

Hello,

I had a question pertaining to a molecular dynamics simulation I'm attempting and wasn't sure how to approach the geometry.

Consider a water molecule (one oxygen, two hydrogens) where the oxygen is centered at the origin.

One hydrogen's center position is randomly assigned (some xi, yi, and zi where the root of the sum of the squares is equal to a known r [the sum of the radii of the two molecules]).

The other hydrogen must be 109.5 degrees removed from the first hydrogen (in any direction) and must be the same radial distance, r, from the oxygen atom.

If you draw this graphically, you will see that the possible positions for the 2nd hydrogen atom is described by a circle. How can I determine the range of possible values for placement of this hydrogen atom relative to the oxygen atom without rotating the axes of the coordinate system each time? (I need to keep the oxygen's center at 0,0,0, and I need to keep the axes oriented the same way no matter where the hydrogen atoms lie.)

Thank you kindly,

Julio

2. Hello Julio

Welcome to Math Help Forum!
Originally Posted by gitarzan16x
Hello,

I had a question pertaining to a molecular dynamics simulation I'm attempting and wasn't sure how to approach the geometry.

Consider a water molecule (one oxygen, two hydrogens) where the oxygen is centered at the origin.

One hydrogen's center position is randomly assigned (some xi, yi, and zi where the root of the sum of the squares is equal to a known r [the sum of the radii of the two molecules]).

The other hydrogen must be 109.5 degrees removed from the first hydrogen (in any direction) and must be the same radial distance, r, from the oxygen atom.

If you draw this graphically, you will see that the possible positions for the 2nd hydrogen atom is described by a circle. How can I determine the range of possible values for placement of this hydrogen atom relative to the oxygen atom without rotating the axes of the coordinate system each time? (I need to keep the oxygen's center at 0,0,0, and I need to keep the axes oriented the same way no matter where the hydrogen atoms lie.)

Thank you kindly,

Julio
In the attached diagram, $O$ is the origin, $H_1 = (x_1, y_1, z_1)$ the position of the first hydrogen atom and $H_2= (x,y,z)$ the (variable) position of the second hydrogen atom. The angle $\angle H_1OH_2 = \theta = 109.5^o$, and I note that $\cos\theta =-\tfrac13$.

$H_2$, then, lies on a circle centre $C$, where $C$ lies on $H_1O$ produced and $OC = r\cos(180-\theta) = \frac{r}{3}$.

The coordinates of $C$ are $(-\tfrac13x_1,-\tfrac13y_1,-\tfrac13z_1)$ and the radius of the circle around which $H_2$ can move is $r\sin(180-\theta)=\frac{2\sqrt2r}{3}$.

Using the dot (scalar product) on the two vectors $\vec{OH_1}, \vec{OH_2}$ we get
$\vec{OH_1}. \vec{OH_2}=x_1x+y_1y+z_1z=r^2\cos\theta=-\frac{r^2}{3}$
which gives the equation of the plane in which $H_2$ can move. It is the intersection of this plane with the sphere
$x^2+y^2+z^2 = r^2$
that determines the circle around which $H_2$ moves.

I hope some of these thoughts may be helpful.