cpp/motions/isosmallangle.cpp

23 lines
632 B
C++
Raw Normal View History

2024-08-23 16:33:38 +00:00
//
// Created by dominik on 8/21/24.
//
#include "isosmallangle.h"
2024-09-16 17:52:51 +00:00
#include "coordinates.h"
2024-08-23 16:33:38 +00:00
SmallAngle::SmallAngle(const double delta, const double eta, const double chi, std::mt19937_64 &rng) :
Motion(std::string("Isotropic Angle Jump"), delta, eta, rng), m_chi(chi * M_PI / 180.0) {};
SmallAngle::SmallAngle(std::mt19937_64 &rng) : Motion(std::string("Isotropic Angle Jump"), rng) {}
2024-08-23 16:33:38 +00:00
void SmallAngle::initialize() {
m_prev_pos = draw_position();
};
double SmallAngle::jump() {
const double gamma{2 * M_PI * m_uni_dist(m_rng)};
2024-09-16 17:52:51 +00:00
m_prev_pos = rotate(m_prev_pos, m_chi, gamma);
2024-08-23 16:33:38 +00:00
return omega_q(m_prev_pos);
}