Maybe anyone knows how can I create a line from the center of any particle (line lenght = particle radius) , which would show direction in which the particle would be moving? I tried working with Vec2D, but got stuck while trying to create an average vector.
Here is the complete script:
import toxi.physics2d.behaviors.*;
import toxi.physics2d.*;
import toxi.geom.*;
import toxi.math.*;
ArrayList <Particle> particles;
ArrayList <Attractor> attractors = new ArrayList <Attractor>();
//Attractor attractor2;
int gridDim = 10;//30
VerletPhysics2D physics;
void setup() {
size(1000, 600);
smooth();
int w = width/gridDim;
int h = height/gridDim;
//INITIALIZE PHYSICS
physics = new VerletPhysics2D();
physics.setDrag(0.1); //JUDEJIMO LAISVUMAS
//INITIALIZE PARTICLE CLASS
particles = new ArrayList<Particle>(); // PO SITO DEDAMI DOUBLE FOR LOOP GRIDUI