reduction of std::pow calls; stronger usage of

Cartesian- and CylinderCoordinate objects
This commit is contained in:
2025-06-02 11:09:57 +02:00
parent f510d0a39a
commit d6578e540d
19 changed files with 120 additions and 77 deletions
+3 -2
View File
@@ -92,7 +92,7 @@ double velocity(double energy_eV, double mass_kg) {
}
double relativisticGamma(const blitz::TinyVector<double, 3>& velocity) {
return std::sqrt(1. + blitz::dot(velocity, velocity) / std::pow(SI::c, 2));
return std::sqrt(1. + blitz::dot(velocity, velocity) / (SI::c*SI::c));
}
double relativisticGamma(double kin_energy_eV, double mass_eV) {
@@ -105,7 +105,8 @@ double relativisticBeta(double velocity_ms) {
double relativisticBeta(double kin_energy_eV, double mass_eV) {
const double gamma = relativisticGamma(kin_energy_eV, mass_eV);
return std::sqrt(1 - std::pow(1 / gamma, 2));
// return std::sqrt(1 - std::pow(1 / gamma, 2));
return std::sqrt(1 - 1 / (gamma*gamma));
}
double relativisticMomentum(double energy_eV, double mass_eV) {