/** * Computes the value of the ratio of the circumradius to shortest edge. If smaller than some * given tolerance B, the associated triangle is considered skinny. For an equal lateral * triangle this value is 0.57735. The ratio is related to the minimum triangle angle theta by: * circumRadius/shortestEdge = 1/(2sin(theta)). * * @param b second vertex of the triangle * @param c third vertex of the triangle * @return ratio of circumradius to shortest edge. */ public double circumRadiusRatio(Vertex b, Vertex c) { Vertex x = this.circleCenter(b, c); double radius = distance(x, b); double edgeLength = distance(this, b); double el = distance(b, c); if (el < edgeLength) { edgeLength = el; } el = distance(c, this); if (el < edgeLength) { edgeLength = el; } return radius / edgeLength; }
/** * Computes the value of the ratio of the circumradius to shortest edge. If smaller than some * given tolerance B, the associated triangle is considered skinny. For an equal lateral * triangle this value is 0.57735. The ratio is related to the minimum triangle angle theta by: * circumRadius/shortestEdge = 1/(2sin(theta)). * * @param b second vertex of the triangle * @param c third vertex of the triangle * @return ratio of circumradius to shortest edge. */ public double circumRadiusRatio(Vertex b, Vertex c) { Vertex x = this.circleCenter(b, c); double radius = distance(x, b); double edgeLength = distance(this, b); double el = distance(b, c); if (el < edgeLength) { edgeLength = el; } el = distance(c, this); if (el < edgeLength) { edgeLength = el; } return radius / edgeLength; }