/packages/apps/Gallery2/src/com/android/gallery3d/filtershow/imageshow/ |
ImageTinyPlanet.java | 67 value = Math.min(mTinyPlanetRep.getMaximum(), value); 68 value = Math.max(mTinyPlanetRep.getMinimum(), value); 88 return (float) (Math.atan2(dx, dy) * 180 / Math.PI); 102 return (float) (((angleB - angleA) % 360) * Math.PI / 180);
|
/packages/apps/LegacyCamera/src/com/android/camera/ |
Util.java | 109 return Math.round(sPixelDensity * dp); 199 (int) Math.ceil(Math.sqrt(w * h / maxNumOfPixels)); 201 (int) Math.min(Math.floor(w / minSideLength), 202 Math.floor(h / minSideLength)); 317 return (float) Math.sqrt(dx * dx + dy * dy); 364 int dist = Math.abs(orientation - orientationHistory); 365 dist = Math.min( dist, 360 - dist ); 390 int targetHeight = Math.min(display.getHeight(), display.getWidth()) [all...] |
/cts/tests/tests/transition/src/android/transition/cts/ |
ChangeImageTransformTest.java | 105 float tx = Math.round((imageViewWidth - imageWidth)/2f); 109 float ty = Math.round((imageViewHeight - imageHeight)/2f); 139 float maxScale = Math.max(scaleX, scaleY); 143 float tx = Math.round((imageViewWidth - width) / 2f); 144 float ty = Math.round((imageViewHeight - height) / 2f); 161 float minScale = Math.min(scaleX, scaleY); 183 float minScale = Math.min(scaleX, scaleY); 199 float minScale = Math.min(scaleX, scaleY); 256 layoutParams.width = Math.round(size); 257 layoutParams.height = Math.round(size * 2) [all...] |
/frameworks/base/packages/WallpaperCropper/src/com/android/wallpapercropper/ |
CropView.java | 77 imageDims[0] = Math.abs(imageDims[0]); 78 imageDims[1] = Math.abs(imageDims[1]); 166 mMinScale = Math.max(w / imageWidth, h / imageHeight); 168 Math.max(mMinScale, resetScale ? Float.MIN_VALUE : mRenderer.scale); 183 mRenderer.scale = Math.max(mMinScale, mRenderer.scale); 205 mCenterX += Math.ceil(edges.left / scale); 210 mRenderer.centerX = Math.round(mCenterX); 211 mRenderer.centerY = Math.round(mCenterY); 302 adjustment[1] = (float) Math.ceil(edges.top / scale); 307 if (coef[dim] > 0) adjustment[dim] = (float) Math.ceil(adjustment[dim]) [all...] |
/frameworks/base/services/core/java/com/android/server/am/ |
TaskLaunchParamsModifier.java | 149 return Math.max(bounds.width() / STEP_DENOMINATOR, MINIMAL_STEP); 154 return Math.max(bounds.height() / STEP_DENOMINATOR, MINIMAL_STEP); 301 return Math.abs(first.left - second.left) < BOUNDS_CONFLICT_MIN_DISTANCE 302 && Math.abs(first.top - second.top) < BOUNDS_CONFLICT_MIN_DISTANCE; 306 return Math.abs(first.right - second.right) < BOUNDS_CONFLICT_MIN_DISTANCE 307 && Math.abs(first.top - second.top) < BOUNDS_CONFLICT_MIN_DISTANCE; 311 return Math.abs(first.left - second.left) < BOUNDS_CONFLICT_MIN_DISTANCE 312 && Math.abs(first.bottom - second.bottom) < BOUNDS_CONFLICT_MIN_DISTANCE; 316 return Math.abs(first.right - second.right) < BOUNDS_CONFLICT_MIN_DISTANCE 317 && Math.abs(first.bottom - second.bottom) < BOUNDS_CONFLICT_MIN_DISTANCE [all...] |
/frameworks/layoutlib/bridge/tests/src/com/android/layoutlib/bridge/intensive/util/ |
ImageUtils.java | 63 int maxDimension = Math.max(image.getWidth(), image.getHeight()); 97 int imageWidth = Math.min(goldenImage.getWidth(), image.getWidth()); 98 int imageHeight = Math.min(goldenImage.getHeight(), image.getHeight()); 142 delta += Math.abs(deltaR); 143 delta += Math.abs(deltaG); 144 delta += Math.abs(deltaB); 156 } else if (Math.abs(goldenImage.getWidth() - image.getWidth()) >= 2) { 160 } else if (Math.abs(goldenImage.getHeight() - image.getHeight()) >= 2) { 207 int destWidth = Math.max(1, (int) (xScale * sourceWidth)); 208 int destHeight = Math.max(1, (int) (yScale * sourceHeight)) [all...] |
/frameworks/rs/tests/java_api/HealingBrush/src/rs/example/android/com/healingbrush/ |
FindRegion.java | 161 minx = Math.min(minx, xy[i]); 162 maxx = Math.max(maxx, xy[i]); 163 miny = Math.min(miny, xy[i + 1]); 164 maxy = Math.max(maxy, xy[i + 1]); 192 int xmin = Math.max(0, (int) (mRoiBounds.left - mRoiBounds.width() * 2)); 193 int ymin = Math.max(0, (int) (mRoiBounds.top - mRoiBounds.height() * 2)); 196 xmax = Math.min(imgWidth, xmax); 197 ymax = Math.min(imgHeight, ymax); 198 xmax = Math.max(0, xmax); 199 ymax = Math.max(0, ymax) [all...] |
/frameworks/support/transition/src/androidTest/java/androidx/transition/ |
ChangeImageTransformTest.java | 94 float tx = Math.round((imageViewWidth - imageWidth) / 2f); 98 float ty = Math.round((imageViewHeight - imageHeight) / 2f); 128 float maxScale = Math.max(scaleX, scaleY); 132 int tx = Math.round((imageViewWidth - width) / 2f); 133 int ty = Math.round((imageViewHeight - height) / 2f); 150 float minScale = Math.min(scaleX, scaleY); 172 float minScale = Math.min(scaleX, scaleY); 188 float minScale = Math.min(scaleX, scaleY); 253 layoutParams.width = Math.round(size); 254 layoutParams.height = Math.round(size * 2) [all...] |
/libcore/ojluni/src/main/java/java/time/chrono/ |
ChronoPeriodImpl.java | 180 Math.addExact(years, amount.years), 181 Math.addExact(months, amount.months), 182 Math.addExact(days, amount.days)); 190 Math.subtractExact(years, amount.years), 191 Math.subtractExact(months, amount.months), 192 Math.subtractExact(days, amount.days)); 221 Math.multiplyExact(years, scalar), 222 Math.multiplyExact(months, scalar), 223 Math.multiplyExact(days, scalar)); 237 return new ChronoPeriodImpl(chrono, Math.toIntExact(splitYears), splitMonths, days) [all...] |
/packages/apps/Messaging/src/com/android/messaging/ui/conversationlist/ |
ConversationListSwipeHelper.java | 77 mMaximumFlingVelocity = Math.min( 134 final float absDeltaX = Math.abs(deltaX); 135 final float absDeltaY = Math.abs(deltaY); 408 return (Math.abs(velocityX) > minVelocity) // Fast enough. 409 && (Math.abs(velocityX) > Math.abs(velocityY)) // Not unintentional. 411 && Math.abs(translationX) > 426 && Math.abs(translationX) > 432 final float durationInSeconds = Math.abs(deltaPosition / velocity); 433 return Math.min((int) (durationInSeconds * UNIT_SECONDS), mMaxTranslationAnimationDuration) [all...] |
/cts/tests/tests/location/src/android/location/cts/psedorange/ |
UserPositionVelocityWeightedLeastSquare.java | 38 import org.apache.commons.math.linear.Array2DRowRealMatrix; 39 import org.apache.commons.math.linear.LUDecompositionImpl; 40 import org.apache.commons.math.linear.QRDecompositionImpl; 41 import org.apache.commons.math.linear.RealMatrix; 372 Math.sqrt(positionH.getEntry(0, 0)), Math.sqrt(positionH.getEntry(1, 1)), 373 Math.sqrt(positionH.getEntry(2, 2)), Math.sqrt(velocityH.getEntry(0, 0)), 374 Math.sqrt(velocityH.getEntry(1, 1)), Math.sqrt(velocityH.getEntry(2, 2))} [all...] |
/cts/tests/tests/renderscript/src/android/renderscript/cts/ |
CoreMathVerifier.java | 225 return t.newFloaty(Math.PI); 229 return t.new32((float) Math.PI); 243 Math.acos(in.mid()), 244 Math.acos(in.min()), 245 Math.acos(in.max())); 286 Math.asin(in.mid()), 287 Math.asin(in.min()), 288 Math.asin(in.max())); 328 Math.atan(in.mid()), 329 Math.atan(in.min()) [all...] |
Float16Utils.java | 37 static double MIN_NORMAL = Math.scalb(1.0, -14); // smallest Float16 normal is 2 ^ -14 38 static double MIN_VALUE = Math.scalb(1.0, -24); // smallest Float16 value is 2 ^ -24 80 float mantissaAsFloat = Math.scalb(mantissa, -10); 91 result = Math.scalb(1, -14) * mantissaAsFloat; 95 result = Math.scalb(1, exponent - 15) * (1 + mantissaAsFloat); 279 return Math.scalb(1.0, (int) (unbiasedExponent - 10)); 302 double positiveValue = Math.abs(value);
|
/cts/tests/tests/media/src/android/media/cts/ |
AudioHelper.java | 37 final double rad = 2 * Math.PI * frequency / sampleRate; 39 sweep = Math.PI * sweep / ((double)sampleRate * vai.length); 41 int unsigned = (int)(Math.sin(j * (rad + j * sweep)) * Byte.MAX_VALUE) 50 final double rad = 2 * Math.PI * frequency / sampleRate; 52 sweep = Math.PI * sweep / ((double)sampleRate * vai.length); 54 vai[j] = (short)(Math.sin(j * (rad + j * sweep)) * Short.MAX_VALUE); 61 final double rad = 2 * Math.PI * frequency / sampleRate; 63 sweep = Math.PI * sweep / ((double)sampleRate * vaf.length); 65 vaf[j] = (float)(Math.sin(j * (rad + j * sweep))); 77 final double rad = numCycles * 2.0 * Math.PI / numFrames [all...] |
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/ |
ExpandableOutlineView.java | 91 int left = Math.max(translation, 0); 93 int right = getWidth() + Math.min(translation, 0); 94 int bottom = Math.max(getActualHeight() - mClipBottomAmount, top); 123 left = Math.max(translation, 0); 125 right = getWidth() + Math.min(translation, 0); 126 bottom = Math.max(getActualHeight(), top); 127 int intersectBottom = Math.max(getActualHeight() - mClipBottomAmount, top); 174 topRoundnessX = Math.min(width / 2, topRoundnessX); 175 bottomRoundnessX = Math.min(width / 2, bottomRoundnessX); 211 int bottom = (int) Math.max(mMinimumHeightForClipping [all...] |
/art/test/530-checker-lse/src/ |
Main.java | 25 return radius * radius * Math.PI; 972 return new Circle(Math.PI).getArea(); [all...] |
/frameworks/base/core/java/android/widget/ |
Magnifier.java | 123 mBitmapWidth = Math.round(mWindowWidth / mZoom); 124 mBitmapHeight = Math.round(mWindowHeight / mZoom); 160 xPosInView = Math.max(0, Math.min(xPosInView, mView.getWidth())); 161 yPosInView = Math.max(0, Math.min(yPosInView, mView.getHeight())); 310 mCenterZoomCoords.x = Math.round(posX); 311 mCenterZoomCoords.y = Math.round(posY); 326 mClampedCenterZoomCoords.x = Math.max(viewVisibleRegion.left + mBitmapWidth / 2, Math.min [all...] |
/frameworks/base/services/tests/servicestests/src/com/android/server/wm/ |
TaskPositionerTests.java | 258 int width = Math.round((float) (r.bottom - MOUSE_DELTA_Y) * MIN_ASPECT); 265 final int h = Math.round(w / MIN_ASPECT); 302 final int h = Math.round((float)w / MIN_ASPECT); 343 int w = Math.max(r.right - r.left, Math.round(h * MIN_ASPECT)); 369 int height = Math.round((float) (r.right - MOUSE_DELTA_X) * MIN_ASPECT); 380 final int w = Math.max(mMinVisibleWidth, Math.round(mMinVisibleHeight / MIN_ASPECT)); 381 final int h = Math.max(mMinVisibleHeight, Math.round(w * MIN_ASPECT)) [all...] |
/external/guava/guava/src/com/google/common/math/ |
DoubleMath.java | 17 package com.google.common.math; 20 import static com.google.common.math.DoubleUtils.IMPLICIT_BIT; 21 import static com.google.common.math.DoubleUtils.SIGNIFICAND_BITS; 22 import static com.google.common.math.DoubleUtils.getSignificand; 23 import static com.google.common.math.DoubleUtils.isFinite; 24 import static com.google.common.math.DoubleUtils.isNormal; 25 import static com.google.common.math.DoubleUtils.scaleNormalize; 26 import static com.google.common.math.MathPreconditions.checkInRange; 27 import static com.google.common.math.MathPreconditions.checkNonNegative; 28 import static com.google.common.math.MathPreconditions.checkRoundingUnnecessary [all...] |
/external/icu/android_icu4j/src/main/java/android/icu/util/ |
IndianCalendar.java | 459 m = Math.min(m, 5); 501 wjd = Math.floor(jd - 0.5) + 0.5; 503 quadricent = Math.floor(depoch / 146097); 505 cent = Math.floor(dqc / 36524); 507 quad = Math.floor(dcent / 1461); 509 yindex = Math.floor(dquad / 365); 522 month = (int)Math.floor((((yearday + leapadj) * 12) + 373) / 367);
|
/external/icu/icu4j/main/classes/core/src/com/ibm/icu/util/ |
IndianCalendar.java | 488 m = Math.min(m, 5); 530 wjd = Math.floor(jd - 0.5) + 0.5; 532 quadricent = Math.floor(depoch / 146097); 534 cent = Math.floor(dqc / 36524); 536 quad = Math.floor(dcent / 1461); 538 yindex = Math.floor(dquad / 365); 551 month = (int)Math.floor((((yearday + leapadj) * 12) + 373) / 367);
|
/external/replicaisland/src/com/replica/replicaisland/ |
PhysicsComponent.java | 86 if (touchingFloor && currentVelocity.y <= 0.0f && Math.abs(newVelocity.x) > 0.0f 92 float frictionCoeffecient = Math.abs(currentVelocity.x) > 0.0f ? 98 final float maxFriction = Math.abs(gravityVector.y) * getMass() 101 if (maxFriction > Math.abs(newVelocity.x)) { 109 if (Math.abs(newVelocity.x) < 0.01f) { 113 if (Math.abs(newVelocity.y) < 0.01f) { 190 final float bounciness = Math.min(getBounciness() + otherBounciness, 1.0f);
|
/frameworks/base/rs/java/android/renderscript/ |
Matrix3f.java | 115 rot *= (float)(java.lang.Math.PI / 180.0f); 116 c = (float)java.lang.Math.cos(rot); 117 s = (float)java.lang.Math.sin(rot); 119 float len = (float)java.lang.Math.sqrt(x*x + y*y + z*z); 152 rot *= (float)(java.lang.Math.PI / 180.0f); 153 c = (float)java.lang.Math.cos(rot); 154 s = (float)java.lang.Math.sin(rot);
|
/frameworks/base/services/core/java/com/android/server/location/ |
LocationFudger.java | 85 private static final double PREVIOUS_WEIGHT = Math.sqrt(1 - NEW_WEIGHT * NEW_WEIGHT); 246 lat = Math.round(lat / latGranularity) * latGranularity; 248 lon = Math.round(lon / lonGranularity) * lonGranularity; 257 coarse.setAccuracy(Math.max(mAccuracyInMeters, coarse.getAccuracy())); 334 return distance / APPROXIMATE_METERS_PER_DEGREE_AT_EQUATOR / Math.cos(Math.toRadians(lat)); 347 mAccuracyInMeters = Math.max(accuracyInMeters, MINIMUM_ACCURACY_IN_METERS);
|
/frameworks/layoutlib/bridge/src/android/graphics/ |
SweepGradient_Delegate.java | 188 angle = (float) (dy < 0 ? 3 * Math.PI / 2 : Math.PI / 2); 190 angle = (float) (dx < 0 ? Math.PI : 0); 192 angle = (float) Math.atan(dy / dx); 195 angle += Math.PI * 2; 198 angle += Math.PI; 203 data[index++] = getGradientColor((float) (angle / (2 * Math.PI)));
|