# How to get tiny lines to swarm together into a circular pattern?

Preferably using Adobe Animate or Illustrator.

Image taken from: https://material.io/guidelines/material-design/introduction.html • Out of interest what's the end use? It looks like a wind or tide flow diagram? – mayersdesign May 3 '17 at 14:53
• I would say Mathematica! – joojaa May 3 '17 at 15:22
• I was curious about @joojaa answer and I found this: wolfram.com/mathematica Looks cool. It's paid, but they offer a 15-day trial – Manly May 3 '17 at 15:35
• @Manly theres is even a mathematica.SE and a image like that is called a vector plot – joojaa May 3 '17 at 15:53
• @Manly if your interested here is code and here result – joojaa May 3 '17 at 16:52

I don't know how to do that with Adobe Animate or Illustrator but you could use Processing.

Here's the code and the result:

``````void setup() {
size(800, 600);
noCursor();
}

void draw() {
background(34,70,135);

stroke(200,75,130);
strokeWeight(2);

int resolution = 25;
PVector attractor = new PVector(mouseX, mouseY);

for (int x=0; x<width; x+=resolution) {
for (int y=0; y<height; y+=resolution) {

PVector v = getSpiralVector(x-attractor.x, y-attractor.y);

v.normalize().mult(resolution/2);

pushMatrix();
translate(x, y);
line( -v.x, -v.y, v.x, v.y);
popMatrix();
}
}

fill(255,50);
noStroke();
ellipse(mouseX,mouseY,200,200);
}

PVector getSpiralVector(float x, float y) {
return  new PVector(y-x, -x-y);
}

void mouseClicked(){
saveFrame(hour()+"_"+minute()+"_"+second()+".png");
}
`````` • Scripting this in illustrator would look much the same. So if you can do this in processing you should be able to do this with illustrators dcripting layer in a few hours of thinking about the datamodel. Good exercise to do. – joojaa May 4 '17 at 2:48
• How would this look in a fiddle? jsfiddle.net/8pbsuscm – Mark Boulder Sep 20 '17 at 0:14
• You should convert it to Javascript and use p5.js, instead of Processing. If I have time today I will do it. – Alberto89 Sep 20 '17 at 9:10