public double transform ( double tolerance ) { // the function should be implemented as follows: find encompassing // circle for the transformed circle of radius = Tolerance. // this is approximation. Point2D pt1 = new Point2D ( ) ; Point2D pt2 = new Point2D ( ) ; /* * pt[0].Set(0, 0); pt[1].Set(1, 0); pt[2].Set(0, 1); Transform(pt); * pt[1] -= pt[0]; pt[2] -= pt[0]; */ pt1 . setCoords ( xx , yx ) ; pt2 . setCoords ( xy , yy ) ; pt1 . sub ( pt1 ) ; double d1 = pt1 . sqrLength ( ) * 0.5 ; pt1 . setCoords ( xx , yx ) ; pt2 . setCoords ( xy , yy ) ; pt1 . add ( pt2 ) ; double d2 = pt1 . sqrLength ( ) * 0.5 ; return tolerance * ( ( d1 > d2 ) ? Math . sqrt ( d1 ) : Math . sqrt ( d2 ) ) ; }
Transforms a tolerance value .