# 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, $\displaystyle O$ is the origin, $\displaystyle H_1 = (x_1, y_1, z_1)$ the position of the first hydrogen atom and $\displaystyle H_2= (x,y,z)$ the (variable) position of the second hydrogen atom. The angle $\displaystyle \angle H_1OH_2 = \theta = 109.5^o$, and I note that $\displaystyle \cos\theta =-\tfrac13$.

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

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

Using the dot (scalar product) on the two vectors $\displaystyle \vec{OH_1}, \vec{OH_2}$ we get
$\displaystyle \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 $\displaystyle H_2$ can move. It is the intersection of this plane with the sphere
$\displaystyle x^2+y^2+z^2 = r^2$
that determines the circle around which $\displaystyle H_2$ moves.

I hope some of these thoughts may be helpful.