Lines Matching refs:radius

102     static private double verticalLineIntersectsCircle(double x, double radius) {
103 return Math.sqrt(radius*radius - x*x);
106 static private double horizontalLineIntersectsCircle(double y, double radius) {
107 return Math.sqrt(radius*radius - y*y);
118 static private double areaUnderChord(double radius, double chordLength) {
119 double isocelesHeight = Math.sqrt(radius*radius - chordLength * chordLength / 4.0);
121 double halfAngle = Math.asin(chordLength / (2.0 * radius));
122 double areaUnderArc = halfAngle * radius * radius;
128 // the circle with center (cx, cy) and radius 'radius'
130 double py, double radius) {
153 if (distanceFromCenterSquared(left, bottom) > radius*radius) {
157 if (distanceFromCenterSquared(right, top) < radius*radius) {
162 if (distanceFromCenterSquared(left, top) > radius*radius) {
163 double triangleWidth = horizontalLineIntersectsCircle(bottom, radius) - left;
164 double triangleHeight = verticalLineIntersectsCircle(left, radius) - bottom;
168 + areaUnderChord(radius, chordLength);
173 if (distanceFromCenterSquared(right, bottom) < radius*radius) {
174 double triangleWidth = right - horizontalLineIntersectsCircle(top, radius);
175 double triangleHeight = top - verticalLineIntersectsCircle(right, radius);
179 + areaUnderChord(radius, chordLength);
183 double trapezoidWidth1 = horizontalLineIntersectsCircle(top, radius) - left;
184 double trapezoidWidth2 = horizontalLineIntersectsCircle(bottom, radius) - left;
187 + areaUnderChord(radius, chordLength);
191 if (top >= 0 && bottom <= 0 && radius > right) {
192 shading -= areaUnderChord(radius, 2 * verticalLineIntersectsCircle(right, radius));
246 double radius = maskWidth / 2.0;
251 double shading = calcPixelShading(cx, cy, px, py, radius);