
for (i=0; i<Nv; i++) {
	for (j=0; j<24; j++) {
		
		if ((Plane_test_p1[i][j] < 0) || (Plane_test_p2[i][j] < 0) || (Plane_test_p3[i][j] < 0))
			continue;
		
		Point1[0] = Vx[Plane_test_p1[i][j]];Point1[1] = Vy[Plane_test_p1[i][j]];Point1[2] = Vz[Plane_test_p1[i][j]];
		Point2[0] = Vx[Plane_test_p2[i][j]];Point2[1] = Vy[Plane_test_p2[i][j]];Point2[2] = Vz[Plane_test_p2[i][j]];
		Point3[0] = Vx[Plane_test_p3[i][j]];Point3[1] = Vy[Plane_test_p3[i][j]];Point3[2] = Vz[Plane_test_p3[i][j]];
		Point0[0] = Vx[i];Point0[1] = Vy[i];Point0[2] = Vz[i];
		
		cout << "The indexes of plane " << j << " for point " << i << " are [" << Plane_test_p1[i][j] << ", " << Plane_test_p2[i][j] << ", " << Plane_test_p1[i][j] <<"]" << endl;
		
		}
		cout << endl;
}



for (t=0;t<T_end; t++){
	
	i=0;
	for (k=0; k<4; k++) {
		AP[k][0] = Vx[C_apver[i][k]]; AP[k][1] = Vy[C_apver[i][k]]; AP[k][2] = Vz[C_apver[i][k]];
		BS[k][0] = Vx[C_bsver[i][k]]; BS[k][1] = Vy[C_bsver[i][k]]; BS[k][2] = Vz[C_bsver[i][k]];
	}
	
	Vx[0] += .001;
	Vx[2] += .001;
	
	/*
	for (i=0; i<Nv; i++) {
		for (j=0; j<24; j++) {
			
			if ((Plane_test_p1[i][j] < 0) || (Plane_test_p2[i][j] < 0) || (Plane_test_p3[i][j] < 0))
				continue;
			
			Point1[0] = Vx[Plane_test_p1[i][j]];Point1[1] = Vy[Plane_test_p1[i][j]];Point1[2] = Vz[Plane_test_p1[i][j]];
			Point2[0] = Vx[Plane_test_p2[i][j]];Point2[1] = Vy[Plane_test_p2[i][j]];Point2[2] = Vz[Plane_test_p2[i][j]];
			Point3[0] = Vx[Plane_test_p3[i][j]];Point3[1] = Vy[Plane_test_p3[i][j]];Point3[2] = Vz[Plane_test_p3[i][j]];
			Point0[0] = Vx[i];Point0[1] = Vy[i];Point0[2] = Vz[i];
			
			cout << "The distance to plane " << j << " from point " << i << " is " << Dis_to_plane(Point1, Point2, Point3, Point0) << endl;
			
		}
		cout << endl;
	}
	 */

	 
	i=0;
		
	if (t % T_record == 0){
		
		Cell_Apical[i] = Area_Calc(AP);//A_0 = A_from_cell(AP, BS);
		Cell_Basal[i] = Area_Calc(BS);//B_0 = B_from_cell(AP, BS);
		Cell_Volume[i] = Volume_Calc(AP, BS);//V_0 = V_from_cell(AP, BS);
		Cell_Lengths_1[i] = sqrt(pow(AP[0][0] - BS[0][0], 2) + pow(AP[0][1] - BS[0][1], 2) + pow(AP[0][2] - BS[0][2], 2));
		Cell_Lengths_2[i] = sqrt(pow(AP[1][0] - BS[1][0], 2) + pow(AP[1][1] - BS[1][1], 2) + pow(AP[1][2] - BS[1][2], 2));
		Cell_Lengths_3[i] = sqrt(pow(AP[2][0] - BS[2][0], 2) + pow(AP[2][1] - BS[2][1], 2) + pow(AP[2][2] - BS[2][2], 2));
		Cell_Lengths_4[i] = sqrt(pow(AP[3][0] - BS[3][0], 2) + pow(AP[3][1] - BS[3][1], 2) + pow(AP[3][2] - BS[3][2], 2));
		
		
		cout << "Volume is " << Cell_Volume[i] << endl;
		
		for (j=0; j<24; j++) {
			
			if ((Plane_test_p1[i][j] < 0) || (Plane_test_p2[i][j] < 0) || (Plane_test_p3[i][j] < 0))
				continue;
			
			Point1[0] = Vx[Plane_test_p1[i][j]];Point1[1] = Vy[Plane_test_p1[i][j]];Point1[2] = Vz[Plane_test_p1[i][j]];
			Point2[0] = Vx[Plane_test_p2[i][j]];Point2[1] = Vy[Plane_test_p2[i][j]];Point2[2] = Vz[Plane_test_p2[i][j]];
			Point3[0] = Vx[Plane_test_p3[i][j]];Point3[1] = Vy[Plane_test_p3[i][j]];Point3[2] = Vz[Plane_test_p3[i][j]];
			Point0[0] = Vx[i];Point0[1] = Vy[i];Point0[2] = Vz[i];
			
			cout << "The distance to plane " << j << " from point " << i << " is " << Dis_to_plane(Point1, Point2, Point3, Point0) << endl;
			
		}
		cout << endl << endl;
		
		
		
		for (i=0; i<Nc; i++) {
			
			for (k=0; k<4; k++) {
				AP[k][0] = Vx[C_apver[i][k]]; AP[k][1] = Vy[C_apver[i][k]]; AP[k][2] = Vz[C_apver[i][k]];
				BS[k][0] = Vx[C_bsver[i][k]]; BS[k][1] = Vy[C_bsver[i][k]]; BS[k][2] = Vz[C_bsver[i][k]];
			}
			
			Cell_Apical[i] = Area_Calc(AP);//A_0 = A_from_cell(AP, BS);
			Cell_Basal[i] = Area_Calc(BS);//B_0 = B_from_cell(AP, BS);
			Cell_Volume[i] = Volume_Calc(AP, BS);//V_0 = V_from_cell(AP, BS);
			Cell_Lengths_1[i] = sqrt(pow(AP[0][0] - BS[0][0], 2) + pow(AP[0][1] - BS[0][1], 2) + pow(AP[0][2] - BS[0][2], 2));
			Cell_Lengths_2[i] = sqrt(pow(AP[1][0] - BS[1][0], 2) + pow(AP[1][1] - BS[1][1], 2) + pow(AP[1][2] - BS[1][2], 2));
			Cell_Lengths_3[i] = sqrt(pow(AP[2][0] - BS[2][0], 2) + pow(AP[2][1] - BS[2][1], 2) + pow(AP[2][2] - BS[2][2], 2));
			Cell_Lengths_4[i] = sqrt(pow(AP[3][0] - BS[3][0], 2) + pow(AP[3][1] - BS[3][1], 2) + pow(AP[3][2] - BS[3][2], 2));
		}
		
		Record_Vert_data(Vx, Vy, Vz, Nv, count, a_record, b_record);
		Record_Cell_data(Cell_Apical, Cell_Basal, Cell_Volume, Cell_Lengths_1, Cell_Lengths_2, Cell_Lengths_3, Cell_Lengths_4, Yolk_V_tmp, Nc, count++, a_record, b_record);
	}
		
}