7 double factorial_value = 1.0;
8 for (
int i=2; i<=x; ++i)
11 return factorial_value;
27 double mu = omega_hat.
z;
28 mu = std::min(mu, 1.0);
29 mu = std::max(mu, -1.0);
31 double theta = acos(mu);
34 if (std::fabs(omega_hat.z) < 1.0e-16)
return {0.0,theta};
36 double cos_phi = omega_hat.x/sin(theta);
37 cos_phi = std::min(cos_phi, 1.0);
38 cos_phi = std::max(cos_phi, -1.0);
41 if (omega_hat.y >= 0.0)
42 return {acos(cos_phi), theta};
45 return {2.0*M_PI - acos(cos_phi), theta};
std::pair< double, double > OmegaToPhiThetaSafe(const chi_mesh::Vector3 &omega)
Vector3 Normalized() const