diff options
Diffstat (limited to 'spheres_infinite.cpp')
-rw-r--r-- | spheres_infinite.cpp | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/spheres_infinite.cpp b/spheres_infinite.cpp index 5287a84..b39f164 100644 --- a/spheres_infinite.cpp +++ b/spheres_infinite.cpp @@ -117,6 +117,28 @@ Gen<double, D, Euclidean<double, D>, double> mGen(double ε) { }; } +Gen<double, D, Euclidean<double, D>, double> rGen(double ε) { + return [ε](model& M, Rng& rng) -> Transformation<double, D, Euclidean<double, D>, double>* { + Vector<double, D> t; + Matrix<double, D> m; + + double θ = rng.uniform((double)0.0, 2 * M_PI); + m(0, 0) = -cos(2 * θ); + m(1, 1) = cos(2 * θ); + m(0, 1) = -2 * cos(θ) * sin(θ); + m(1, 0) = -2 * cos(θ) * sin(θ); + + Spin<double, D, double>* s = rng.pick(M.s); + t = M.s0.t; + for (unsigned j = 0; j < D; j++) { + t(j) += rng.variate<double, std::normal_distribution>(0.0, ε); + } + + Euclidean<double, D> g(t - m * t, m); + return new SpinFlip<double, D, Euclidean<double, D>, double>(M, g, s); + }; +} + int main(int argc, char* argv[]) { const unsigned D = 2; @@ -179,8 +201,9 @@ int main(int argc, char* argv[]) { return H * s.x.norm(); }; - auto g1 = eGen(1); + auto g1 = eGen(2); auto g2 = mGen(0.5); + auto g3 = rGen(5); animation A(L, 750, argc, argv); model sphere(1.0, Z, B); @@ -197,7 +220,7 @@ int main(int argc, char* argv[]) { sphere.dict.insert(ss); } - sphere.wolff(T, {g1, g2}, A, N); + sphere.wolff(T, {g1, g2, g3}, A, N); std::ofstream outfile; outfile.open("test.dat"); |