All four of the centers above occur at the same point for an equilateral triangle. Use differential elements consisting of rectangular vertical slices of width dx and height y. {{courseNav.course.mDynamicIntFields.lessonCount}} lessons Not sure what college you want to attend yet? polar-coordinates. From the above table, we can say the new centroid for cluster 1 is (2.0, 1.0) and for cluster 2 is (2.67, 4.67) Iteration 2: Is your centroid x value within this range? 792 2 2 gold badges 8 8 silver badges 20 20 bronze badges. Working Scholars® Bringing Tuition-Free College to the Community. xG = 6.00 in. ;) System.out.println("Centroid: "+(centroid+1)); // '+1' for output in 1-based index } static int[] queue=new int[MAXN],leftOver; // Step 3 static int findCentroid(int r) { leftOver=new int[N]; int i,target=N/2,ach=-1; bfs(r); // Step 4 for(i=N-1;i>=0;--i) if(queue[i]!=r) leftOver[parent[queue[i]]] += leftOver[queue[i]] +1; // Step 5 for(i=0;i