【问题标题】:Force-directed graphing力导向绘图
【发布时间】:2010-08-31 06:16:52
【问题描述】:

我正在尝试为我自己构建的图形应用程序编写强制导向或强制图集代码库。这是我正在尝试的示例:http://sawamuland.com/flash/graph.html

我设法在 Wiki Force-atlas 文章中找到了一些伪代码来完成我想要的。因为它是一个 Flash 应用程序,所以我已将其转换为 ActionScript 3.0 代码。这是我的来源:

var timestep:int = 0;
var damping:int  = 0;
var total_kinetic_engery:int = 0;

for (var node in list) {
 var net_force:int = 0;
 for (var other_node in list) {
  net_force += coulombRepulsion(node, other_node, nodeList);
 }
 for (var spring in list[node].relations) {
  net_force += hookeAttraction(node, spring, nodeList);
 }
 list[node].velocity += (timestep * net_force) * damping;
 list[node].position += timestep * list[node].velocity;
 total_kinetic_engery += list[node].mass * (list[node].velocity) ^ 2;
}

现在的问题是找到伪代码或函数来执行库仑斥力和胡克引力代码。我不完全确定如何做到这一点。

有没有人知道我可以查看的很好的参考资料...快速理解和实施?

最好的。

【问题讨论】:

    标签: actionscript-3 math graphing


    【解决方案1】:

    在同一篇文章中有指向这些内容的链接。 Hooke's 是链接末端节点之间的弹簧力,而库仑力将附近的节点推开。

    问题不是真正的表达式,而是它们内部应用的常量。我会阅读原始文章,google for “Fruchterman, T. M. J., & Reingold, E. M. (1991). Graph Drawing by Force-Directed Placement. Software: Practice and Experience, 21(11)。” 和通读 pdf 以了解作者的建议。

    顺便说一句,你的变量可能必须是浮点数,而不是整数。

    【讨论】:

      【解决方案2】:

      你看过flare吗?有一个带有力导向图的演示。

      【讨论】:

        猜你喜欢
        • 2013-02-17
        • 2017-08-16
        • 2012-12-23
        • 2020-09-28
        • 1970-01-01
        • 2014-07-23
        • 2014-06-13
        • 2014-02-27
        • 2015-07-30
        相关资源
        最近更新 更多