/** * Computes the centre of the circumcircle of this vertex and two others. * * @param b * @param c * @return the Coordinate which is the circumcircle of the 3 points. */ public Vertex circleCenter(Vertex b, Vertex c) { Vertex a = new Vertex(this.getX(), this.getY()); // compute the perpendicular bisector of cord ab HCoordinate cab = bisector(a, b); // compute the perpendicular bisector of cord bc HCoordinate cbc = bisector(b, c); // compute the intersection of the bisectors (circle radii) HCoordinate hcc = new HCoordinate(cab, cbc); Vertex cc = null; try { cc = new Vertex(hcc.getX(), hcc.getY()); } catch (NotRepresentableException nre) { System.err.println("a: " + a + " b: " + b + " c: " + c); System.err.println(nre); } return cc; }
/** * Computes the centre of the circumcircle of this vertex and two others. * * @param b * @param c * @return the Coordinate which is the circumcircle of the 3 points. */ public Vertex circleCenter(Vertex b, Vertex c) { Vertex a = new Vertex(this.getX(), this.getY()); // compute the perpendicular bisector of cord ab HCoordinate cab = bisector(a, b); // compute the perpendicular bisector of cord bc HCoordinate cbc = bisector(b, c); // compute the intersection of the bisectors (circle radii) HCoordinate hcc = new HCoordinate(cab, cbc); Vertex cc = null; try { cc = new Vertex(hcc.getX(), hcc.getY()); } catch (NotRepresentableException nre) { System.err.println("a: " + a + " b: " + b + " c: " + c); System.err.println(nre); } return cc; }