private Point coordinatesCalculator(Point p) {
            Point temp = new Point(p);
            p.x = -1;
            p.y = -1;
            for (int i = 0; i < vIntersectionsNumber; i++) {
                if (temp.x >= ((leftMargin - CIRCLESIZE / 2) + (i + 1) * INTERSPACE)
                        && temp.x <= ((leftMargin - CIRCLESIZE / 2) + (i + 1) * INTERSPACE + CIRCLESIZE)) {
                    p.x = i;
                }
            }
            for (int i = 0; i < hIntersectionsNumber; i++) {
                if (temp.y >= ((topMargin - CIRCLESIZE / 2) + (i + 1) * INTERSPACE)
                        && temp.y <= ((topMargin - CIRCLESIZE / 2) + (i + 1) * INTERSPACE + CIRCLESIZE)) {
                    p.y = i;
                }
            }
            return p;
        }