public static float[][][] getJoinCenter(float[][][] p, float[][] c,
			int cluster) {
		float temp = 0;
		float tmp = 0;
		float belong = 0;

		for (int i = 0; i < p.length; i++) {
			if ((int) p[i][0][0] == cluster) {
				temp = Calculate.getDistance(p[i], c[0]);
				belong = c[0][0];
				for (int j = 1; j < c.length; j++) {
					tmp = Calculate.getDistance(p[i], c[j]);
					// cluster the point to nearest centroid
					if (temp > tmp) {
						temp = tmp;
						belong = c[j][0];
					}
				}
				p[i][0][0] = belong;
			}
		}
		return p;
	}