2024-08-16 17:55:27 +00:00
|
|
|
//
|
|
|
|
// Created by dominik on 8/16/24.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef RWSIM_MOTIONTETRAHEDRAL_H
|
|
|
|
#define RWSIM_MOTIONTETRAHEDRAL_H
|
|
|
|
|
|
|
|
#include "base.h"
|
|
|
|
#include <random>
|
2024-08-18 11:21:27 +00:00
|
|
|
#include <cmath>
|
|
|
|
#include <array>
|
2024-08-16 17:55:27 +00:00
|
|
|
|
|
|
|
class TetrahedralJump final : public Motion {
|
|
|
|
public:
|
|
|
|
TetrahedralJump(double, double, std::mt19937_64&);
|
|
|
|
explicit TetrahedralJump(std::mt19937_64&);
|
|
|
|
|
2024-08-18 11:21:27 +00:00
|
|
|
void initialize() override;
|
2024-08-16 17:55:27 +00:00
|
|
|
double jump() override;
|
2024-08-18 11:21:27 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
const double m_beta{std::acos(-1/3.)};
|
2024-08-20 15:51:49 +00:00
|
|
|
const double m_cos_beta{-1./3.};
|
|
|
|
const double m_sin_beta{ 2. * std::sqrt(2.)/3. };
|
|
|
|
|
2024-08-18 11:21:27 +00:00
|
|
|
std::array<double, 4> m_corners{};
|
2024-08-20 15:51:49 +00:00
|
|
|
int m_corner_idx{0};
|
|
|
|
|
|
|
|
std::uniform_int_distribution<> m_chooser{1, 3};
|
|
|
|
|
2024-08-16 17:55:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif //RWSIM_MOTIONTETRAHEDRAL_H
|