private void find_divisionplane(Balloon bal1, Balloon bal2, BalloonPopulation BP0, BalloonPopulation BP1)
	 { /* BEGIN find_divisionplane*/
		// draw cell division
		boolean start = false;
		double x0 = 0;
		double y0 = 0;
		double x1 = 0;
		double y1 = 0;
		double x=0;
		double y=0;
		double xm=0; double ym=0;					// point in the middle of the wall


		//
		//	identify the points that constitute the plan of cell difivion of the cell and place them in div_plan
		//
		Vector div_plan = new Vector();					// list of points that constitue the cell wall
		for (int j=0;j<bal1.n0;j++)
			{
			if (BP1.contacts[bal1.id][j] == bal2.id)
				{
				double dist = 100000;
				x0 = bal1.XX[j];
				y0 = bal1.YY[j];
				for (int k=0;k<bal2.n0;k++)
					{
					if (Math.sqrt((x0-bal2.XX[k])*(x0-bal2.XX[k]) + (y0-bal2.YY[k])*(y0-bal2.YY[k]))<dist)
						{
						x1 = bal2.XX[k];
						y1 = bal2.YY[k];
						dist = Math.sqrt((x0-bal2.XX[k])*(x0-bal2.XX[k]) + (y0-bal2.YY[k])*(y0-bal2.YY[k]));
						}
					}
				double[] xy = {(x0+x1)/2, (y0+y1)/2};
				xm+=(x0+x1)/2; ym+=(y0+y1)/2;

				Balloon bal_mother = (Balloon)(BP0.BallList.get(bal1.id_mother));
				div_plan.addElement(xy);
				}
			}
		int n = div_plan.size();
		Matrix X = new Matrix(n,2,1);
		Matrix Y = new Matrix(n,1,0);
		xm/=n; ym/=n;

		//
		//  least square to fin the line going through the points
		//
		Balloon Bmother = (Balloon)(BP0.BallList.get(bal1.id_mother));

		for (int j=0;j<div_plan.size();j++)
		{
			double[] xy = (double[])(div_plan.get(j));
			X.set(j,0,xy[0]);
			Y.set(j,0,xy[1]);
		}


		//
		// Find the limit for the axis from the mother cell boundaries
		//
		boolean is_loop = true;
		double alpha;
		if (X.rank()>1)
			{Matrix coeff = X.solve(Y);			// coeffs of the regression over the points defining the division plant
			alpha = Math.atan(coeff.get(0,0));
			}
		else{
			alpha = (bal1.y0 - bal2.y0)/(bal2.x0 - bal1.x0);
			}

		int i=1;
		int CX[] = new int[Bmother.XX.length];
		int CY[] = new int[Bmother.XX.length];
		for (int k=0;k<CX.length;k++)
		{
			CX[k] = (int)Bmother.XX[k];
			CY[k] = (int)Bmother.YY[k];
		}
		Polygon cell = new Polygon(CX,CY,CX.length);
		while (is_loop)
		{
			x0 = (int)(xm-i*Math.cos(alpha));
			y0 = (int)(ym-i*Math.sin(alpha));
			is_loop = cell.contains(x0,y0);
			i+=1;
		}
		Bmother.div_x0 = (int)(xm-i*Math.cos(alpha)*0.5); Bmother.div_y0 = (int)(ym-i*Math.sin(alpha)*0.5);
		is_loop = true;
		while (is_loop)
		{
			x1 = (int)(xm+i*Math.cos(alpha));
			y1 = (int)(ym+i*Math.sin(alpha));
			is_loop = cell.contains(x1,y1);
			i+=1;
		}
		Bmother.div_x1 = (int)(xm+i*Math.cos(alpha)*0.5); Bmother.div_y1 = (int)(ym+i*Math.sin(alpha)*0.5);
	 } /* END find_divisionplane*/