BraggPredictionRotation: Guard for negative rotation direction

This commit is contained in:
2026-01-03 14:50:10 +01:00
parent c2559ed510
commit 68e99afc9e
2 changed files with 3 additions and 1 deletions
@@ -27,6 +27,8 @@ namespace {
inline int solve_trig(float A, float B, float D,
float phi0, float phi1,
float out_phi[2]) {
if (phi1 < phi0) std::swap(phi0, phi1);
const float R = std::sqrt(A*A + B*B);
if (!(R > 0.0f))
return 0;
@@ -15,7 +15,7 @@
class BraggPredictionRotation : public BraggPrediction {
public:
BraggPredictionRotation(int max_reflections);
BraggPredictionRotation(int max_reflections = 200*200*200);
int Calc(const DiffractionExperiment &experiment,
const CrystalLattice &lattice,