diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2020-02-10 13:53:50 -0500 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2020-02-10 13:53:50 -0500 |
commit | 0d3e2e5b91129249849cb4b48ed1631a5eed02ba (patch) | |
tree | e33d13264ecb6178ef0708488392900708dcd850 | |
parent | 53f05e5f0bc0b79b4422ecfbb3dde7e346fdddd4 (diff) | |
download | space_wolff-0d3e2e5b91129249849cb4b48ed1631a5eed02ba.tar.gz space_wolff-0d3e2e5b91129249849cb4b48ed1631a5eed02ba.tar.bz2 space_wolff-0d3e2e5b91129249849cb4b48ed1631a5eed02ba.zip |
Fixed bug in generator of reflections, now actually reflects near centers.
-rw-r--r-- | spheres_infinite.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/spheres_infinite.cpp b/spheres_infinite.cpp index dba7ab3..9bc86d7 100644 --- a/spheres_infinite.cpp +++ b/spheres_infinite.cpp @@ -73,18 +73,18 @@ std::function<Euclidean<double, D>(const model&, randutils::mt19937_rng&)> eGen( Matrix<double, D> m; double θ = rng.uniform((double)0.0, 2 * M_PI); - m(0, 0) = cos(θ); - m(1, 1) = cos(θ); - m(0, 1) = sin(θ); - m(1, 0) = -sin(θ); + m(0, 0) = -cos(2 * θ); + m(1, 1) = cos(2 * θ); + m(0, 1) = -2 * cos(θ) * sin(θ); + m(1, 0) = -2 * cos(θ) * sin(θ); unsigned f_ind = rng.uniform((unsigned)0, (unsigned)M.s.size()); - t = M.s[f_ind].x; + t = M.s[f_ind].x; for (unsigned j = 0; j < D; j++) { - t(j) = rng.variate<double, std::normal_distribution>(0.0, ε); + t(j) += rng.variate<double, std::normal_distribution>(0.0, ε); } - Euclidean<double, D> g(t, m); + Euclidean<double, D> g(t - m * t, m); return g; }; } @@ -145,7 +145,7 @@ int main(int argc, char* argv[]) { return H * s.x.norm(); }; - auto g = eGen(0.25); + auto g = eGen(0.05); animation A(L, 750, argc, argv); model sphere(1, Z, B); |