Advertisement
Guest User

Untitled

a guest
Dec 7th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. public static PhysicsVector SumAcceleration(GravitationalField[][] Field, int Body)
  2. {
  3. int NumBodies = 2;
  4. double Totalx = 0;
  5. double Totaly = 0;
  6. double Totalz = 0;
  7. for(int i = 0; i < NumBodies; i++)
  8. {
  9. Totalx =+ Field[i][Body].getX();
  10. Totaly =+ Field[i][Body].getY();
  11. Totalz =+ Field[i][Body].getZ();
  12. }
  13. PhysicsVector Total = new PhysicsVector(Totalx, Totaly, Totalz);
  14. return Total;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement