Tackiest way I can describe a vector field. “When All Eyes Are On You”.

Tackiest way I can describe a vector field.
“When All Eyes Are On You”.

It’s fine in physics but when humans actually start believing that THEY THEMSELVES are a “gravitational center” or a some kind of magnetic monopole, it’s usually delusional. So they do things to continue having people look their way or talk as if “all eyes are on them”.

That said, sometimes it’s true.

CODE (stolen) for Processing 3:

void setup() {
size(480, 480, P2D);
smooth(4);
}

int boxSize = 20;
float vectorLen = boxSize – 4;

void draw() {
background(200);
cursor(CROSS);
PVector mouse = new PVector(mouseX, mouseY);
rectMode(CENTER);
stroke(0);
for (int x = boxSize / 2; x < width; x += boxSize) {
for (int y = boxSize / 2; y < height; y += boxSize) {
PVector p = new PVector(x, y);
PVector diff = PVector.sub(p, mouse).normalize().mult(vectorLen / 2);
PVector p0 = PVector.sub(p, diff);
PVector p1 = PVector.add(p, diff);
line(p0.x, p0.y, p1.x, p1.y);

ellipse(mouseX, mouseY,1,1);
}
}
}

Leave a comment

Your email address will not be published. Required fields are marked *


1 × = eight

Leave a Reply