Skip to content
Snippets Groups Projects
Commit 74c7f735 authored by Stephen D's avatar Stephen D
Browse files

Collision catalyst handles stars with NAN coords/velocities

parent d739f817
No related branches found
No related tags found
No related merge requests found
......@@ -54,8 +54,8 @@ point_t calculateCoM(RigidMass_t *stars, int nStars)
double totalY = 0;
for(int i = 0; i < nStars; i++)
{
totalX += stars[i].x;
totalY += stars[i].y;
if(!isnan(stars[i].x)) totalX += stars[i].x;
if(!isnan(stars[i].y)) totalY += stars[i].y;
}
point_t out;
out.x = totalX / nStars;
......@@ -71,8 +71,8 @@ point_t calculateCoV(RigidMass_t *stars, int nStars)
double totalVy = 0;
for(int i = 0; i < nStars; i++)
{
totalVx += stars[i].vx;
totalVy += stars[i].vy;
if(!isnan(stars[i].vx)) totalVx += stars[i].vx;
if(!isnan(stars[i].vy)) totalVy += stars[i].vy;
}
point_t out;
out.x = totalVx / nStars;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment