next up previous contents
Next: Quadrupole moment Up: Families of spheres Previous: Drawing the family   Contents

Dipole moment

``Dipole moment'' is a fancy word, for chemists, to designate a center of mass. The point is, that the center of mass (giving each sphere unit mass) is a desirable origin of coordinates, which for artistic reasons might reasonably occupy the center of a drawing of the spheres. It is hard to imagine that scientific reasons might dictate another choice, but the possibility always exists.

One point of caution: the artistic dipole moment described here is neither the center of mass (since individual atomic weights are not taken into account) nor the electrical dipole moment (since no charges are considered).

/* calculate dipole moment */

void geodm(w,s,n) double w[3], *s[7]; int n; {
double en; int i;
en=(double)n;
w[0]=w[1]=w[2]=0.0;
for (i=0; i<n; i++) {w[0]+=s[0][i]; w[1]+=s[1][i];w[2]+=s[2][i];}
w[0]/=en; w[1]/=en; w[2]/=en;
}



Pedro Hernandez 2004-05-13