title: how to calculate centroid of an arraylist of points
body: <p>I am trying to add up all the x and y coordiantes respectively from points of ArrayList.</p>
  
  <pre><code>public static ArrayList knots = new ArrayList&lt;Point&gt;();
  
  
  
  public Point centroid()  {
          Point center = new Point();
              for(int i=0; i&lt;knots.size(); i++) {
              ????????????????????
          return center;
  }
  </code></pre>
  
  <p>How do I find the centroid ??</p>