chiark / gitweb /
get sign right, but it is still wrong
authorIan Jackson <ian@davenant.relativity.greenend.org.uk>
Fri, 4 Jan 2008 19:21:11 +0000 (19:21 +0000)
committerIan Jackson <ian@davenant.relativity.greenend.org.uk>
Fri, 4 Jan 2008 19:21:11 +0000 (19:21 +0000)
graph.c

diff --git a/graph.c b/graph.c
index 31e317d..74d93bf 100644 (file)
--- a/graph.c
+++ b/graph.c
@@ -44,7 +44,7 @@ void graph_layout_prepare() {
     breadth_first_search(v1, sqdistances[v1]);
 
   alpha= 2;
-  beta= -log(10)/log(alpha);
+  beta= log(10)/log(alpha);
   beta_prime= (1-beta)/2;
   printf("alpha=%g beta=%g beta'=%g\n", alpha,beta,beta_prime);
 }
@@ -93,7 +93,7 @@ double graph_layout_cost(const Vertices v, const double vertex_areas[N]) {
 
       double s2= dist2 * meanedgelength2;
 
-      /* energy = (d/s)^(1-beta)     where beta is -log\_{alpha}(10)
+      /* energy = (d/s)^(1-beta)     where beta is log\_{alpha}(10)
        * energy = ((d/s)^2) ^ (1-beta)/2
        *          let beta' = (1-beta)/2
        */