37 static const double pi=M_PI;
38 static const double pih=M_PI_2;
39 static const double tpi=2.0*pi;
41 static const double bohr = 0.52917706;
46 delta(
double u[],
const double a[],
const double b[])
57 dist(
const double a[],
const double b[])
60 return (sqrt((x=a[0]-b[0])*x + (y=a[1]-b[1])*y + (z=a[2]-b[2])*z));
69 double tmp = 1.0 - x*x;
70 if (tmp < 0.0) tmp = 0.0;
78 scalar(
const double a[],
const double b[])
81 double x1 = a[1]*b[1];
91 norm(
double u[],
const double a[],
const double b[])
94 double x = 1.0/sqrt(scalar(u,u));
95 u[0] *= x; u[1] *= x; u[2] *= x;
102 normal(
const double a[],
const double b[],
double w[])
104 w[0] = a[1]*b[2]-a[2]*b[1];
105 w[1] = a[2]*b[0]-a[0]*b[2];
106 w[2] = a[0]*b[1]-a[1]*b[0];
107 double x = 1.0/sqrt(scalar(w,w));
108 w[0] *= x; w[1] *= x; w[2] *= x;