am 29923a44: am a6e8e0d8: Merge "Remove dependencies on FloatMath"

* commit '29923a44e65d97b211484f6667c3155bfc396ec9':
  Remove dependencies on FloatMath
This commit is contained in:
Neil Fuller
2014-10-15 10:34:45 +00:00
committed by Android Git Automerger
5 changed files with 6 additions and 7 deletions

View File

@@ -22,7 +22,6 @@ import android.content.Context;
import android.graphics.*;
import android.os.Bundle;
import android.view.*;
import android.util.FloatMath;
public class BitmapMesh extends GraphicsActivity {
@@ -92,7 +91,7 @@ public class BitmapMesh extends GraphicsActivity {
float dx = cx - x;
float dy = cy - y;
float dd = dx*dx + dy*dy;
float d = FloatMath.sqrt(dd);
float d = (float) Math.sqrt(dd);
float pull = K / (dd + 0.000001f);
pull /= (d + 0.000001f);

View File

@@ -167,7 +167,7 @@ public class ColorPickerDialog extends Dialog {
public boolean onTouchEvent(MotionEvent event) {
float x = event.getX() - CENTER_X;
float y = event.getY() - CENTER_Y;
boolean inCenter = java.lang.Math.sqrt(x*x + y*y) <= CENTER_RADIUS;
boolean inCenter = java.lang.Math.hypot(x, y) <= CENTER_RADIUS;
switch (event.getAction()) {
case MotionEvent.ACTION_DOWN:

View File

@@ -483,7 +483,7 @@ public class GameView extends View {
}
static float pythag(float x, float y) {
return (float) Math.sqrt(x * x + y * y);
return (float) Math.hypot(x, y);
}
static int blend(float alpha, int from, int to) {