diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua')
-rw-r--r-- | Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua index 35dc21008fb..b53bc9bff98 100644 --- a/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua +++ b/Master/texmf-dist/tex/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua @@ -8,7 +8,7 @@ -- -- See the file doc/generic/pgf/licenses/LICENSE for more information --- @release $Header: /cvsroot/pgf/pgf/generic/pgf/graphdrawing/lua/pgf/gd/force/SpringHu2006.lua,v 1.1 2012/11/27 17:24:25 tantau Exp $ +-- @release $Header$ @@ -64,7 +64,6 @@ local lib = require("pgf.gd.lib") - function SpringHu2006:run() -- Setup some parameters @@ -214,7 +213,7 @@ function SpringHu2006:computeInitialLayout(graph, spring_length) -- position the loose node relative to the fixed node, with -- the displacement (random direction) matching the spring length - local direction = Vector.new{x = math.random(1, spring_length), y = math.random(1, spring_length)} + local direction = Vector.new{x = lib.random(1, spring_length), y = lib.random(1, spring_length)} local distance = 1.8 * spring_length * self.graph_density * math.sqrt(self.graph_size) / 2 local displacement = direction:normalized():timesScalar(distance) @@ -226,7 +225,7 @@ function SpringHu2006:computeInitialLayout(graph, spring_length) -- use a random positioning technique local function positioning_func(n) local radius = 2 * spring_length * self.graph_density * math.sqrt(self.graph_size) / 2 - return math.random(-radius, radius) + return lib.random(-radius, radius) end -- compute initial layout based on the random positioning technique @@ -384,4 +383,4 @@ end -- done -return SpringHu2006
\ No newline at end of file +return SpringHu2006 |