Animation III: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) No edit summary |
A WASSERMANN (talk | contribs) No edit summary |
||
Line 12: | Line 12: | ||
p[i].moveTo([Math.random(),Math.random()],800); | p[i].moveTo([Math.random(),Math.random()],800); | ||
} | } | ||
i = 0; | |||
while (i<p.length) { | |||
for (j=i+1;j<p.length;j++) { | for (j=i+1;j<p.length;j++) { | ||
if (p[i].Dist(p[j])<0.05) { | if (p[i].Dist(p[j])<0.05) { | ||
Line 20: | Line 21: | ||
p.splice(i,1); | p.splice(i,1); | ||
i--; | i--; | ||
} | break; | ||
} | |||
} | } | ||
i++; | |||
} | } | ||
},2000); | },2000); | ||
</jsxgraph> | </jsxgraph> |