We know from simple physics that on MP which has a mass a gravity force is equal to , where is a gravity vector and is MP mass. In our two dimensional space we simply update all the forces of all particles to be equal to
/* gravity */ for(i=1 ; i <= NUMP ; ++i) { myPoints[i].fx = 0; myPoints[i].fy = MASS * GY * (Pressure - FINAL_PRESSURE >= 0); }