300.0
300
300
300.0
2
filename
forceDirectionVDG$0.mml
date
1361680977000
url
/Users/ddamelin/Documents/CC Stuff/Interactions/MWActiviites/forceDirectionVDG/forceDirectionVDG$0.mml
size
92426
codebase
/Users/ddamelin/Documents/CC Stuff/Interactions/MWActiviites/forceDirectionVDG
define %atomX;
define %atomY;
define %prevX %atom[0].rx;
define %prevY %atom[0].ry;
define %dx "(%atom[1].rx - %atom[0].rx)/10";
define %dy "(%atom[1].ry - %atom[0].ry)/10";
define %atanX %dx;
define %atanY %dy;
define %atanAngle;
define %vecLen 4.0;
define %lastX %atom[0].rx;
define %lastY %atom[0].ry;
define %imageNum 0;
define %imageWidth 4.4;
define %imageHeight 0.8;
define %chargeFactor 3.14159;
define %i 0;
define %interval 5;
define %lineIdx 2;
define %tracingOn 0;
define %stampTime 0;
define %VDG 97;
runtask atan2;
beginmouse:pressed;
if (%number_of_textboxes ==1);
select textbox all;
remove;
endif;
endmouse:pressed;
beginmouse:dragged;
runtask updateView;
endmouse:dragged;
false
atan2
if (%atanX >0);
set %atanAngle atan(%atanY/%atanX);
endif;
if ((%atanY >= 0) and (%atanX < 0));
set %atanAngle atan(%atanY/%atanX) + pi;
endif;
if ((%atanY < 0) and (%atanX < 0));
set %atanAngle atan(%atanY/%atanX) - pi;
endif;
if ((%atanY >0) and (%atanX == 0));
set %atanAngle pi/2;
endif;
if ((%atanY <0) and (%atanX == 0));
set %atanAngle -1*pi/2;
endif;
if ((%atanY == 0) and (%atanX == 0));
set %atanAngle -1;
endif;
if (%atanAngle != -1);
set %atanAngle %atanAngle+%chargeFactor;
endif;
false
clearVectors
define %z 1;
while (%z < %VDG);
set line[%z].coordinates (100,100,110,110);
%z++;
endwhile;
false
updateView
set atom[0].rx %mouse_x/10;
set atom[0].ry %mouse_y/10;
set %dx (%atom[1].rx - %atom[0].rx)/10;
set %dy (%atom[1].ry - %atom[0].ry)/10;
set %atanX %dx;
set %atanY %dy;
runtask atan2;
set %atomX %atom[0].rx;
set %atomY %atom[0].ry;
set line[0].x1 %atomX;
set line[0].y1 %atomY;
set line[0].x2 cos(%atanAngle)*%vecLen+%atomX;
set line[0].y2 sin(%atanAngle)*%vecLen+%atomY;
set %atomX %atom[1].rx;
set %atomY %atom[1].ry;
set line[%VDG].x1 %atomX;
set line[%VDG].y1 %atomY;
set line[%VDG].x2 cos(%atanAngle)*%vecLen*-1+%atomX;
set line[%VDG].y2 sin(%atanAngle)*%vecLen*-1+%atomY;
select none;
%i++;
set %stampTime (mod(%i,%interval) == 0);
if (%tracingOn and %stampTime);
if (%lineIdx < %VDG);
set line[%lineIdx].coordinates (%line[0].x1, %line[0].y1, %line[0].x2, %line[0].y2);
%lineIdx++;
endif;
endif;
1.0
0
0
0
255
true
None
-3355444
255
0
255
255
vdg.png
1
97
129.0
164.0
0
255
0
255
2
2
3
157.99993896484375
1.2207031E-4
46.0
40.0
2
2
1
false
3
1050.0
-100.0
1050.0
-100.0
2
2
2
3
1050.0
-100.0
1050.0
-100.0
2
2
3
3
1050.0
-100.0
1050.0
-100.0
2
2
4
3
1050.0
-100.0
1050.0
-100.0
2
2
5
3
1050.0
-100.0
1050.0
-100.0
2
2
6
3
1050.0
-100.0
1050.0
-100.0
2
2
7
3
1050.0
-100.0
1050.0
-100.0
2
2
8
3
1050.0
-100.0
1050.0
-100.0
2
2
9
3
1050.0
-100.0
1050.0
-100.0
2
2
10
3
1050.0
-100.0
1050.0
-100.0
2
2
11
3
1050.0
-100.0
1050.0
-100.0
2
2
12
3
1050.0
-100.0
1050.0
-100.0
2
2
13
3
1050.0
-100.0
1050.0
-100.0
2
2
14
3
1050.0
-100.0
1050.0
-100.0
2
2
15
3
1050.0
-100.0
1050.0
-100.0
2
2
16
3
1050.0
-100.0
1050.0
-100.0
2
2
17
3
1050.0
-100.0
1050.0
-100.0
2
2
18
3
1050.0
-100.0
1050.0
-100.0
2
2
19
3
1050.0
-100.0
1050.0
-100.0
2
2
20
3
1050.0
-100.0
1050.0
-100.0
2
2
21
3
1050.0
-100.0
1050.0
-100.0
2
2
22
3
1050.0
-100.0
1050.0
-100.0
2
2
23
3
1050.0
-100.0
1050.0
-100.0
2
2
24
3
1050.0
-100.0
1050.0
-100.0
2
2
25
3
1050.0
-100.0
1050.0
-100.0
2
2
26
3
1050.0
-100.0
1050.0
-100.0
2
2
27
3
1050.0
-100.0
1050.0
-100.0
2
2
28
3
1050.0
-100.0
1050.0
-100.0
2
2
29
3
1050.0
-100.0
1050.0
-100.0
2
2
30
3
1050.0
-100.0
1050.0
-100.0
2
2
31
3
1050.0
-100.0
1050.0
-100.0
2
2
32
3
1050.0
-100.0
1050.0
-100.0
2
2
33
3
1050.0
-100.0
1050.0
-100.0
2
2
34
3
1050.0
-100.0
1050.0
-100.0
2
2
35
3
1050.0
-100.0
1050.0
-100.0
2
2
36
3
1050.0
-100.0
1050.0
-100.0
2
2
37
3
1050.0
-100.0
1050.0
-100.0
2
2
38
3
1050.0
-100.0
1050.0
-100.0
2
2
39
3
1050.0
-100.0
1050.0
-100.0
2
2
40
3
1050.0
-100.0
1050.0
-100.0
2
2
41
3
1050.0
-100.0
1050.0
-100.0
2
2
42
3
1050.0
-100.0
1050.0
-100.0
2
2
43
3
1050.0
-100.0
1050.0
-100.0
2
2
44
3
1050.0
-100.0
1050.0
-100.0
2
2
45
3
1050.0
-100.0
1050.0
-100.0
2
2
46
3
1050.0
-100.0
1050.0
-100.0
2
2
47
3
1050.0
-100.0
1050.0
-100.0
2
2
48
3
1050.0
-100.0
1050.0
-100.0
2
2
49
3
1050.0
-100.0
1050.0
-100.0
2
2
50
3
1050.0
-100.0
1050.0
-100.0
2
2
51
3
1050.0
-100.0
1050.0
-100.0
2
2
52
3
1050.0
-100.0
1050.0
-100.0
2
2
53
3
1050.0
-100.0
1050.0
-100.0
2
2
54
3
1050.0
-100.0
1050.0
-100.0
2
2
55
3
1050.0
-100.0
1050.0
-100.0
2
2
56
3
1050.0
-100.0
1050.0
-100.0
2
2
57
3
1050.0
-100.0
1050.0
-100.0
2
2
58
3
1050.0
-100.0
1050.0
-100.0
2
2
59
3
1050.0
-100.0
1050.0
-100.0
2
2
60
3
1050.0
-100.0
1050.0
-100.0
2
2
61
3
1050.0
-100.0
1050.0
-100.0
2
2
62
3
1050.0
-100.0
1050.0
-100.0
2
2
63
3
1050.0
-100.0
1050.0
-100.0
2
2
64
3
1050.0
-100.0
1050.0
-100.0
2
2
65
3
1050.0
-100.0
1050.0
-100.0
2
2
66
3
1050.0
-100.0
1050.0
-100.0
2
2
67
3
1050.0
-100.0
1050.0
-100.0
2
2
68
3
1050.0
-100.0
1050.0
-100.0
2
2
69
3
1050.0
-100.0
1050.0
-100.0
2
2
70
3
1050.0
-100.0
1050.0
-100.0
2
2
71
3
1050.0
-100.0
1050.0
-100.0
2
2
72
3
1050.0
-100.0
1050.0
-100.0
2
2
73
3
1050.0
-100.0
1050.0
-100.0
2
2
74
3
1050.0
-100.0
1050.0
-100.0
2
2
75
3
1050.0
-100.0
1050.0
-100.0
2
2
76
3
1050.0
-100.0
1050.0
-100.0
2
2
77
3
1050.0
-100.0
1050.0
-100.0
2
2
78
3
1050.0
-100.0
1050.0
-100.0
2
2
79
3
1050.0
-100.0
1050.0
-100.0
2
2
80
3
1050.0
-100.0
1050.0
-100.0
2
2
81
3
1050.0
-100.0
1050.0
-100.0
2
2
82
3
1050.0
-100.0
1050.0
-100.0
2
2
83
3
1050.0
-100.0
1050.0
-100.0
2
2
84
3
1050.0
-100.0
1050.0
-100.0
2
2
85
3
1050.0
-100.0
1050.0
-100.0
2
2
86
3
1050.0
-100.0
1050.0
-100.0
2
2
87
3
1050.0
-100.0
1050.0
-100.0
2
2
88
3
1050.0
-100.0
1050.0
-100.0
2
2
89
3
1050.0
-100.0
1050.0
-100.0
2
2
90
3
1050.0
-100.0
1050.0
-100.0
2
2
91
3
1050.0
-100.0
1050.0
-100.0
2
2
92
3
1050.0
-100.0
1050.0
-100.0
2
2
93
3
1050.0
-100.0
1050.0
-100.0
2
2
94
3
1050.0
-100.0
1050.0
-100.0
2
2
95
3
1050.0
-100.0
1050.0
-100.0
2
2
96
3
1050.0
-100.0
1050.0
-100.0
2
1
98
false
3
158.00006103515625
-1.2207031E-4
208.0
-40.0
0
0
255
255
false
false
2
true
144
65
255
255
192
255
1
99
2
Drag this
43.0
33.0
2
1.0
false
158.0
66.0
3
-1.0
false
false
158.0
188.0