From 0d3e2e5b91129249849cb4b48ed1631a5eed02ba Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Mon, 10 Feb 2020 13:53:50 -0500 Subject: Fixed bug in generator of reflections, now actually reflects near centers. --- spheres_infinite.cpp | 16 ++++++++-------- 1 file 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(const model&, randutils::mt19937_rng&)> eGen( Matrix 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(0.0, ε); + t(j) += rng.variate(0.0, ε); } - Euclidean g(t, m); + Euclidean 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); -- cgit v1.2.3-70-g09d2