summaryrefslogtreecommitdiff
path: root/hard_spheres.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'hard_spheres.cpp')
-rw-r--r--hard_spheres.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/hard_spheres.cpp b/hard_spheres.cpp
index b53f7cf..6a14953 100644
--- a/hard_spheres.cpp
+++ b/hard_spheres.cpp
@@ -29,10 +29,23 @@ int main(int argc, char* argv[]) {
HardSphere<2>& s1 = r.pick(m.particles);
HardSphere<2>& s2 = r.pick(m.particles);
-
- m.swap(1, s1, s2, r);
- if (i % (N * 3) == 0) {
+ Vector<2> t1 = s1.x;
+ Vector<2> t2 = s2.x;
+ Vector<2> t = (t1 + t2) / 2;
+
+ Matrix<2> mat;
+
+ mat(0, 0) = -1;
+ mat(1, 1) = -1;
+ mat(0, 1) = 0;
+ mat(1, 0) = 0;
+
+ Euclidean<2> g(t - mat * t, mat);
+
+ std::cout << m.clusterFlip(1, g, s1, r) << std::endl;
+
+ if (i % (N) == 0) {
draw(m);
}
}