Merge pull request #504 from andeplane/hexorder_fix

Using correct ndegree instead of nnn
This commit is contained in:
sjplimp 2017-06-15 08:24:25 -06:00 committed by GitHub
commit 1ec9e588ff
1 changed files with 4 additions and 4 deletions

View File

@ -248,7 +248,7 @@ inline void ComputeHexOrderAtom::calc_qn_complex(double delx, double dely, doubl
double x = delx*rinv;
double y = dely*rinv;
std::complex<double> z(x, y);
std::complex<double> zn = pow(z, nnn);
std::complex<double> zn = pow(z, ndegree);
u = real(zn);
v = imag(zn);
}
@ -259,9 +259,9 @@ inline void ComputeHexOrderAtom::calc_qn_complex(double delx, double dely, doubl
inline void ComputeHexOrderAtom::calc_qn_trig(double delx, double dely, double &u, double &v) {
double ntheta;
if(fabs(delx) <= MY_EPSILON) {
if(dely > 0.0) ntheta = nnn * MY_PI / 2.0;
else ntheta = nnn * 3.0 * MY_PI / 2.0;
} else ntheta = nnn * atan(dely / delx);
if(dely > 0.0) ntheta = ndegree * MY_PI / 2.0;
else ntheta = ndegree * 3.0 * MY_PI / 2.0;
} else ntheta = ndegree * atan(dely / delx);
u = cos(ntheta);
v = sin(ntheta);
}