title: Is there a way to iterate this so I don't have to add every each function?
body: <p>Is there a way to iterate this so I don't have to add every each function?
  Lets say I have 4 planets and I want to add every gforcex to planet[1].forcex.
  (this is from an n-body simulation project)</p>
  <pre><code>planet[1].forcex = 
      gforcex(planet[1].posx, planet[1].posy, planet[2].posx, planet[2].posy) 
    + gforcex(planet[1].posx, planet[1].posy, planet[3].posx, planet[3].posy) 
    + gforcex(planet[1].posx, planet[1].posy, planet[4].posx, planet[4].posy);
  </code></pre>