/packages/screensavers/PhotoTable/src/com/android/dreams/phototable/ |
PhotoTouchListener.java | 72 alpha = (float) (Math.atan2(pts[2*a + 1] - pts[2*b + 1], 74 180f / Math.PI); 103 final float v = (float) Math.hypot(dX, dY); 110 final float n = (float) Math.max(1.0, (- Math.log(v) / Math.log(mBeta))); 112 final float s = (float) Math.max(0.0, (v * (1f - Math.pow(mBeta, n)) / (1f - mBeta))); 172 if (dt > 0f && (Math.abs(tmpDX) > 5f || Math.abs(tmpDY) > 5f)) [all...] |
/cts/apps/CtsVerifier/src/com/android/cts/verifier/audio/ |
Common.java | 55 * (1 - Math.cos(2 * Math.PI * i / windowWidth)); 82 int prefixLength = (int) Math.round(PREFIX_LENGTH_S * rate); 86 samplePrefixArray[i] = (1 - index + Math.floor(index)) * prefixArray[(int) Math.floor(index)] 87 + (1 + index - Math.ceil(index)) * prefixArray[(int) Math.ceil(index)];
|
/cts/apps/CtsVerifier/src/com/android/cts/verifier/sensors/ |
SensorSynchronizationTestActivity.java | 102 double maxTimestamp = Math.max(accMovementTimestamp, 104 maxTimestamp = Math.max(gyrMovementTimestamp, maxTimestamp); 106 double minTimestamp = Math.min(accMovementTimestamp, 108 minTimestamp = Math.min(gyrMovementTimestamp, minTimestamp); 152 return Math.toDegrees(Math.acos((vec1[0] * vec2[0] + vec1[1] * vec2[1] + vec1[2] * vec2[2]) 157 return Math.sqrt(vec1[0] * vec1[0] + vec1[1] * vec1[1] + vec1[2] * vec1[2]);
|
/cts/tests/tests/openglperf/src/android/openglperf/cts/ |
Sphere.java | 19 import java.lang.Math; 61 float angleStepI = ((float) Math.PI / nSlices); 62 float angleStepJ = ((2.0f * (float) Math.PI) / nSlices); 86 float sini = (float) Math.sin(angleStepI * i); 87 float sinj = (float) Math.sin(angleStepJ * j); 88 float cosi = (float) Math.cos(angleStepI * i); 89 float cosj = (float) Math.cos(angleStepJ * j);
|
/frameworks/base/core/java/android/transition/ |
SidePropagation.java | 93 int left = loc[0] + Math.round(sceneRoot.getTranslationX()); 94 int top = loc[1] + Math.round(sceneRoot.getTranslationY()); 118 return Math.round(duration * directionMultiplier / mPropagationSpeed * distanceFraction); 136 distance = right - viewX + Math.abs(epicenterY - viewY); 139 distance = bottom - viewY + Math.abs(epicenterX - viewX); 142 distance = viewX - left + Math.abs(epicenterY - viewY); 145 distance = viewY - top + Math.abs(epicenterX - viewX);
|
Explode.java | 135 + Math.round(sceneRoot.getTranslationX()); 137 + Math.round(sceneRoot.getTranslationY()); 150 xVector = (Math.random() * 2) - 1; 151 yVector = (Math.random() * 2) - 1; 153 double vectorSize = Math.hypot(xVector, yVector); 160 outVector[0] = (int) Math.round(maxDistance * xVector); 161 outVector[1] = (int) Math.round(maxDistance * yVector); 165 int maxX = Math.max(focalX, sceneRoot.getWidth() - focalX); 166 int maxY = Math.max(focalY, sceneRoot.getHeight() - focalY); 167 return Math.hypot(maxX, maxY) [all...] |
/frameworks/base/packages/SystemUI/src/com/android/systemui/statusbar/phone/ |
NearestTouchFrame.java | 113 int x = Math.min(Math.abs(left - (int) event.getX()), 114 Math.abs((int) event.getX() - right)); 115 int y = Math.min(Math.abs(top - (int) event.getY()), 116 Math.abs((int) event.getY() - bottom)); 118 return Math.max(x, y);
|
/frameworks/support/transition/src/main/java/androidx/transition/ |
SidePropagation.java | 94 int left = loc[0] + Math.round(sceneRoot.getTranslationX()); 95 int top = loc[1] + Math.round(sceneRoot.getTranslationY()); 119 return Math.round(duration * directionMultiplier / mPropagationSpeed * distanceFraction); 139 distance = right - viewX + Math.abs(epicenterY - viewY); 142 distance = bottom - viewY + Math.abs(epicenterX - viewX); 145 distance = viewX - left + Math.abs(epicenterY - viewY); 148 distance = viewY - top + Math.abs(epicenterX - viewX);
|
/packages/apps/Gallery2/src/com/android/gallery3d/util/ |
MotionEventHelper.java | 106 v[0] = (float) Math.sin(angleRadians); 107 v[1] = (float) -Math.cos(angleRadians); 111 float result = (float) Math.atan2(v[0], -v[1]); 112 if (result < -Math.PI / 2) { 113 result += Math.PI; 114 } else if (result > Math.PI / 2) { 115 result -= Math.PI;
|
/packages/apps/Launcher3/src/com/android/launcher3/allapps/ |
AllAppsFastScrollHelper.java | 148 : Math.min(availableScrollHeight, mRv.getCurrentScrollY(newPosition, 0)); 151 float ySign = Math.signum(deltaY); 152 int step = (int) (ySign * Math.ceil((float) Math.abs(deltaY) / numFrames)); 155 mFastScrollFrames[i] = (int) (ySign * Math.min(Math.abs(step), Math.abs(deltaY)));
|
/packages/apps/Gallery/src/com/android/camera/ |
HighlightView.java | 113 int d = (int) Math.round(Math.cos(/*45deg*/Math.PI / 4D) 188 (int) Math.sqrt(distX * distX + distY * distY); 191 if (Math.abs(delta) <= hysteresis) { 192 if (Math.abs(distY) > Math.abs(distX)) { 219 if ((Math.abs(r.left - x) < hysteresis) && verticalCheck) { 222 if ((Math.abs(r.right - x) < hysteresis) && verticalCheck) { 225 if ((Math.abs(r.top - y) < hysteresis) && horizCheck) [all...] |
/frameworks/base/packages/SystemUI/src/com/android/systemui/ |
SwipeHelper.java | 192 float result = Math.abs(translation / viewSize); 193 return Math.min(Math.max(mMinSwipeProgress, result), mMaxSwipeProgress); 199 return Math.max(1 - progress, 0); 202 return 1f - Math.max(0, Math.min(1, progress / SWIPE_PROGRESS_FADE_END)); 243 view.invalidate((int) Math.floor(childBounds.left), 244 (int) Math.floor(childBounds.top), 245 (int) Math.ceil(childBounds.right), 246 (int) Math.ceil(childBounds.bottom)) [all...] |
/external/tensorflow/tensorflow/examples/android/src/org/tensorflow/demo/ |
TensorFlowYoloDetector.java | 115 return (float) (1. / (1. + Math.exp(-x))); 121 max = Math.max(max, val); 125 vals[i] = (float) Math.exp(vals[i] - max); 198 final float w = (float) (Math.exp(output[offset + 2]) * ANCHORS[2 * b + 0]) * blockSize; 199 final float h = (float) (Math.exp(output[offset + 3]) * ANCHORS[2 * b + 1]) * blockSize; 203 Math.max(0, xPos - w / 2), 204 Math.max(0, yPos - h / 2), 205 Math.min(bitmap.getWidth() - 1, xPos + w / 2), 206 Math.min(bitmap.getHeight() - 1, yPos + h / 2)); 237 for (int i = 0; i < Math.min(pq.size(), MAX_RESULTS); ++i) [all...] |
/packages/apps/Gallery2/src/com/android/gallery3d/app/ |
EyePosition.java | 45 private static final float USER_ANGEL = (float) Math.toRadians(10); 46 private static final float USER_ANGEL_COS = (float) Math.cos(USER_ANGEL); 47 private static final float USER_ANGEL_SIN = (float) Math.sin(USER_ANGEL); 130 float length = (float) Math.sqrt(tx * tx + ty * ty + tz * tz); 131 float glength = (float) Math.sqrt(temp); 139 mZ = (float) -Math.sqrt( 155 mZ = (float) -Math.sqrt( 172 mX = Utils.clamp((float) (mX + x * t / Math.hypot(mZ, mX)), 174 mY = Utils.clamp((float) (mY + y * t / Math.hypot(mZ, mY)), 177 mZ = (float) -Math.sqrt [all...] |
/packages/apps/Launcher3/quickstep/src/com/android/quickstep/ |
LongSwipeHelper.java | 52 Math.min(1 / MIN_PROGRESS_TO_ALL_APPS, 1 / (1 - MIN_PROGRESS_TO_ALL_APPS)); 74 mMaxSwipeDistance = Math.max(1, controller.getProgress() * controller.getShiftRange()); 76 .createAnimationToNewWorkspace(ALL_APPS, Math.round(2 * mMaxSwipeDistance)); 108 long expectedDuration = Math.abs(Math.round((endProgress - currentFraction) 110 duration = Math.min(MAX_SWIPE_DURATION, expectedDuration); 117 if (Math.abs(velocity) > minFlingVelocity && mMaxSwipeDistance > 0) { 123 long baseDuration = Math.round(1000 * Math.abs(distanceToTravel / velocity)); 124 duration = Math.min(MAX_SWIPE_DURATION, 2 * baseDuration) [all...] |
/frameworks/base/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/ |
Utilities.java | 123 return Math.max(min, Math.min(max, value)); 130 return Math.max(min, Math.min(max, value)); 137 return Math.max(0f, Math.min(1f, value)); 178 bgR = (bgR < 0.03928f) ? bgR / 12.92f : (float) Math.pow((bgR + 0.055f) / 1.055f, 2.4f); 179 bgG = (bgG < 0.03928f) ? bgG / 12.92f : (float) Math.pow((bgG + 0.055f) / 1.055f, 2.4f); 180 bgB = (bgB < 0.03928f) ? bgB / 12.92f : (float) Math.pow((bgB + 0.055f) / 1.055f, 2.4f); 186 fgR = (fgR < 0.03928f) ? fgR / 12.92f : (float) Math.pow((fgR + 0.055f) / 1.055f, 2.4f) [all...] |
/frameworks/opt/datetimepicker/src/com/android/datetimepicker/time/ |
RadialSelectorView.java | 168 mSelectionRadians = selectionDegrees * Math.PI / 180; 201 double hypotenuse = Math.sqrt( 210 int distanceToInnerNumber = (int) Math.abs(hypotenuse - innerNumberRadius); 212 int distanceToOuterNumber = (int) Math.abs(hypotenuse - outerNumberRadius); 241 int distanceToNumber = (int) Math.abs(hypotenuse - mLineLength); 252 float opposite = Math.abs(pointY - mYCenter); 253 double radians = Math.asin(opposite / hypotenuse); 254 int degrees = (int) (radians * 180 / Math.PI); 281 mCircleRadius = (int) (Math.min(mXCenter, mYCenter) * mCircleRadiusMultiplier); 298 int pointX = mXCenter + (int) (mLineLength * Math.sin(mSelectionRadians)) [all...] |
/libcore/ojluni/src/test/java/time/tck/java/time/chrono/ |
CopticDate.java | 214 case DAY_OF_WEEK: return Math.floorMod(toEpochDay() + 3, 7) + 1; 264 case WEEKS: return plusDays(Math.multiplyExact(amountToAdd, 7)); 267 case DECADES: return plusYears(Math.multiplyExact(amountToAdd, 10)); 268 case CENTURIES: return plusYears(Math.multiplyExact(amountToAdd, 100)); 269 case MILLENNIA: return plusYears(Math.multiplyExact(amountToAdd, 1000)); 278 return plusMonths(Math.multiplyExact(years, 13)); 286 long calcEm = Math.addExact(curEm, months); 287 int newYear = Math.toIntExact(Math.floorDiv(calcEm, 13)); 288 int newMonth = (int)Math.floorMod(calcEm, 13) + 1 [all...] |
/packages/apps/Launcher2/src/com/android/launcher2/ |
AppWidgetResizeFrame.java | 136 mBackgroundPadding = (int) Math.ceil(density * BACKGROUND_PADDING); 178 mDeltaX = Math.max(-mBaselineX, deltaX); 179 mDeltaX = Math.min(mBaselineWidth - 2 * mTouchTargetWidth, mDeltaX); 181 mDeltaX = Math.min(mDragLayer.getWidth() - (mBaselineX + mBaselineWidth), deltaX); 182 mDeltaX = Math.max(-mBaselineWidth + 2 * mTouchTargetWidth, mDeltaX); 186 mDeltaY = Math.max(-mBaselineY, deltaY); 187 mDeltaY = Math.min(mBaselineHeight - 2 * mTouchTargetWidth, mDeltaY); 189 mDeltaY = Math.min(mDragLayer.getHeight() - (mBaselineY + mBaselineHeight), deltaY); 190 mDeltaY = Math.max(-mBaselineHeight + 2 * mTouchTargetWidth, mDeltaY); 244 if (Math.abs(hSpanIncF) > RESIZE_THRESHOLD) [all...] |
/art/test/530-checker-lse2/src/ |
Main.java | 28 return (+ (Math.multiplyExact(mI, mI))); 34 return super.a() + ((int) (Math.max(364746077.0f, ((float) mD)))); 130 mI = (Math.min(((int) new Integer(mI)), (766538816 * (++mI)))); 149 mJ /= ((long) (Math.nextDown(-1519600008.0f))); 150 mJ <<= (Math.round(1237681786.0)); 165 mJ >>= (Math.incrementExact(mJ));
|
/art/test/631-checker-fp-abs/src/ |
Main.java | 18 * A few tests of Math.abs for floating-point data. 21 * we require that Math.abs() clears the sign bit (but changes nothing else) 38 return Math.abs(f); 48 return Math.abs(d); 59 for (float f = -1.5f; f <= -1.499f; f = Math.nextAfter(f, Float.POSITIVE_INFINITY)) { 62 for (float f = 1.499f; f <= 1.5f; f = Math.nextAfter(f, Float.POSITIVE_INFINITY)) { 99 for (double d = -1.5d; d <= -1.49999999999d; d = Math.nextAfter(d, Double.POSITIVE_INFINITY)) { 102 for (double d = 1.49999999999d; d <= 1.5; d = Math.nextAfter(d, Double.POSITIVE_INFINITY)) {
|
/art/test/660-checker-simd-sad-long/src/ |
Main.java | 47 int min_length = Math.min(x.length, y.length); 50 sad += Math.abs(x[i] - y[i]); 74 int min_length = Math.min(x.length, y.length); 109 int min_length = Math.min(x.length, y.length); 146 int min_length = Math.min(x.length, y.length); 149 sad += Math.abs(x[i] - y[i]);
|
/external/drrickorang/LoopbackApp/app/src/main/java/org/drrickorang/loopback/ |
PerformanceMeasurement.java | 88 log("percent difference between two means: " + (Math.abs(meanAfterDiscard - mean) / mean)); 116 int start = Math.max(0, mExpectedBufferPeriodMs - acceptableOffset); 117 int end = Math.min(mBufferData.length - 1, mExpectedBufferPeriodMs + acceptableOffset); 141 int threshold = Math.min(mBufferData.length, mExpectedBufferPeriodMs * mOutliersThreshold); 144 weight = Math.abs(i - mExpectedBufferPeriodMs); 262 standardDeviation = Math.sqrt(sumDeviation / (count - 1));
|
/external/guava/guava/src/com/google/common/cache/ |
CacheStats.java | 222 Math.max(0, hitCount - other.hitCount), 223 Math.max(0, missCount - other.missCount), 224 Math.max(0, loadSuccessCount - other.loadSuccessCount), 225 Math.max(0, loadExceptionCount - other.loadExceptionCount), 226 Math.max(0, totalLoadTime - other.totalLoadTime), 227 Math.max(0, evictionCount - other.evictionCount));
|
/external/replicaisland/src/com/replica/replicaisland/ |
SphereCollisionVolume.java | 115 otherRadius = Math.max(deltaX, deltaY); 137 maxX = Math.max(getMaxX(), other.getMaxX()); 138 minX = Math.min(getMinX(), other.getMinX()); 139 maxY = Math.max(getMaxY(), other.getMaxY()); 140 minY = Math.min(getMinY(), other.getMinY()); 149 final float diameter = Math.max(horizontalDelta, verticalDelta);
|