Skip to content

Commit

Permalink
Change particle sim parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
leonmavr committed Sep 15, 2024
1 parent b7e5619 commit ec46e42
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ static size_t ids = 0;
static float random_norm() {
return (float) random() / RAND_MAX;
}
static float accel = -5;
static float accel = -6;
static int niters = 600;

int main() {
Expand All @@ -36,8 +36,8 @@ int main() {
for (int i = 0; i < NPARTICLES; ++i) {
point_t p = {random() % boundary.x1, random() % boundary.y1, ids++};
particles[i].point = p;
particles[i].velx = (random_norm() > 0.66) ? 5 + random_norm()*10 : -5 - random_norm()*10;
particles[i].vely = (random_norm() > 0.66) ? -5 - random_norm()*10 : 5 + random_norm()*10;
particles[i].velx = (random_norm() > 0.66) ? 3 + random_norm()*8 : -3 - random_norm()*8;
particles[i].vely = (random_norm() > 0.66) ? -3 - random_norm()*8 : 3 + random_norm()*8;
particles[i].accelerationy = accel;
particles[i].accelerationx = 0;
}
Expand Down

0 comments on commit ec46e42

Please sign in to comment.