public PointF getMiddlePoint(Circle circle1, Circle circle2) { return new PointF((circle1.getX() + circle2.getX()) / 2.0f , (circle1.getY() + circle2.getY() ) / 2.0f); }
public void Inicialization_BigMaya() { #region Dynamic inicialization of the mayas_corner mayas_corner = new List<Circle>(); int count = 0; for (int k = 0; k < numMayas; k++) { Circle lstCirculos = new Circle(); Circle circulo_0 = new Circle(); Circle circulo_1 = new Circle(); Circle circulo_2 = new Circle(); Circle circulo_3 = new Circle(); int lineasHorizontales = 0; int lineasVerticales = 0; lstCirculos.circles.Add(circulo_0); lstCirculos.circles.Add(circulo_1); lstCirculos.circles.Add(circulo_2); lstCirculos.circles.Add(circulo_3); for (int j = 0; j < 2; j++) { for (int i = 0; i < 2; i++) { int index = j * 2 + i; // Ubications mayas_corner' drag and drop circles in pixels positions ERG : (i * 93) + 376 if (k == 0) // DNI { lineasHorizontales = 9; lineasVerticales = 7; //lstCirculos.circles[index].set_X((i * 93) + 376); //lstCirculos.circles[index].set_Y((j * 95) + 121); } if (k == 1) // Opcion Albergue { lineasHorizontales = 4; lineasVerticales = 1; //lstCirculos.circles[index].set_X((i * 14) + 308); //lstCirculos.circles[index].set_Y((j * 42) + 163); // 8.4 } if (k == 2) //respuestas { lineasHorizontales = 34; lineasVerticales = 26; //lstCirculos.circles[index].set_X((i * 347) + 111); //lstCirculos.circles[index].set_Y((j * 356) + 246); } if (k == 3) { //identify the markers per each test and use in lineasHorizontales = FILAS; lineasVerticales = COLUMNAS; //lstCirculos.circles[index].set_X((i * 372) + 98);//97 //lstCirculos.circles[index].set_Y((j * 502) + 110);//100 //lstCirculos.circles[0].set_X(p1.X); //lstCirculos.circles[0].set_Y(p1.Y); //lstCirculos.circles[1].set_X(p2.X); //lstCirculos.circles[1].set_Y(p2.Y); //lstCirculos.circles[2].set_X(p3.X); //lstCirculos.circles[2].set_Y(p3.Y); //lstCirculos.circles[3].set_X(p4.X); //lstCirculos.circles[3].set_Y(p4.Y); } } } lstCirculos.set_X(lineasVerticales); lstCirculos.set_Y(lineasHorizontales); mayas_corner.Add(lstCirculos); if (k >= 5) count++; } #endregion }
public PointF findOneMissingPointFromSquare(Circle circles, bool a, bool b, bool c, bool d) { int count_corner = 0; if (a) count_corner++; if (b) count_corner++; if (c) count_corner++; if (d) count_corner++; if (count_corner < 3) return new PointF(0,0); if (!a) { return new PointF(circles.circles[1].getX() + circles.circles[2].getX() - circles.circles[3].getX() , circles.circles[1].getY() + circles.circles[2].getY() - circles.circles[3].getY()); } else if (!b) { return new PointF(circles.circles[3].getX() + circles.circles[0].getX() - circles.circles[2].getX(), circles.circles[3].getY() + circles.circles[0].getY() - circles.circles[2].getY()); } else if (!c) { return new PointF(circles.circles[3].getX() + circles.circles[0].getX() - circles.circles[1].getX(), circles.circles[3].getY() + circles.circles[0].getY() - circles.circles[1].getY()); } else { return new PointF(circles.circles[1].getX() + circles.circles[2].getX() - circles.circles[0].getX(), circles.circles[1].getY() + circles.circles[2].getY() - circles.circles[0].getY()); } //PointF pm = new PointF(); //if (!a || !d) //{ // pm = getMiddlePoint(circles.circles[1], circles.circles[2]); // if (!a) // { // return new PointF(2 * pm.X - circles.circles[3].getX() , 2 * pm.Y - circles.circles[3].getY()); // } // else // { // return new PointF(2 * pm.X - circles.circles[0].getX(), 2 * pm.Y - circles.circles[0].getY()); // } //} //else// (!b || !d) //{ // pm = getMiddlePoint(circles.circles[0], circles.circles[3]); // if (!b) // { // return new PointF(2 * pm.X - circles.circles[3].getX(), 2 * pm.Y - circles.circles[3].getY()); // } // else // { // return new PointF(2 * pm.X - circles.circles[1].getX(), 2 * pm.Y - circles.circles[1].getY()); // } //} }