나는 자신을 위해 구축하고있는 그래프 응용 프로그램을위한 force-directed 또는 force-atlas 코드 기반을 작성하려고합니다. 다음은 내가 시도한 것의 예입니다. http://sawamuland.com/flash/graph.htmlForce-directed graphing
위키 포스 - 아틀라스 기사에서 내가 원하는 것을 달성하기 위해 의사 코드를 찾을 수있었습니다. 이 코드는 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;
}
이제 의사 코드 또는 쿨롱 반발과 훅 매력 코드를 수행하는 기능을 찾는 문제. 나는 이것을 정확하게 수행하는 방법을 확신하지 못합니다.
누구든지 내가 볼 수있는 훌륭한 참고 자료를 알고 있습니까? 빨리 이해하고 구현할 수 있습니까?
최고.