Inhale/Exhale Particles

#1

I want to make a system of particles that move in a way that make them appear to inhale/exhale. In other words, have particles floating then slowing come together, then slowly spread out once again. Whats the easiest way I could do this? I have some circles already coded that slowly are moving back and forth but I am not sure how to make them move in the manner I would like. Here is what I have so far:

for (int i = 0; i < 800; i++) {

    ofPoint point(ofMap(ofNoise(ofRandom(50) + ofGetFrameNum() * 0.00003), 0, 1, width * -0.5, width * 1.5),
                  ofMap(ofNoise(ofRandom(50) + ofGetFrameNum() * 0.00001), 0, 1, height * -0.5, height * 1.5));
    float radius = ofRandom(1, 2);
    ofColor circle_color;
    circle_color.setHsb(0, 0, 300);
    
    if (timer < 60) {
        ofSetColor(255, 255, 255, 255 * ofGetElapsedTimef()/70);
        ofDrawCircle(point, radius);
    }
    else {
        ofPushMatrix();
        ofFill();
        ofSetColor(255, 255, 255);
        ofDrawCircle(point, radius);
        ofFill();
        
    }
#2

One of the problems might be the randomness it currently has. You’re basically drawing a random blob every frame, with a slightly different size. Because the locations are completely random every time, there is no unity in the movement.

It might help to make actual particles, small points that you can keep track of and move around. So instead of having the points appear in a random place every frame, slowly move each point towards a random target somewhere in the center, and than each to a random point on the outside again. This will help to create this in and out movement. Maybe add some easing as well, so the points move slower as they approach their target position on the inhale, then stop, and slowly start moving towards their new target on the exhale.