コード例 #1
0
 public static float[] rotateAroundCenter(
     final float[] array, final float n, final float n2, final float n3) {
   if (n != 0.0f) {
     final float degToRad = degToRad(n);
     final float sin = FloatMath.sin(degToRad);
     final float cos = FloatMath.cos(degToRad);
     for (int i = -2 + array.length; i >= 0; i -= 2) {
       final float n4 = array[i];
       final float n5 = array[i + 1];
       array[i] = n2 + (cos * (n4 - n2) - sin * (n5 - n3));
       array[i + 1] = n3 + (sin * (n4 - n2) + cos * (n5 - n3));
     }
   }
   return array;
 }
コード例 #2
0
ファイル: Main.java プロジェクト: kstv/DexHunter
  public void run() {
    InstField instField = new InstField();
    instField.run();

    StaticField.run();

    IntMath.run();
    FloatMath.run();
    Compare.run();

    Monitor.run();
    Switch.run();
    Array.run();
    Classes.run();
    Goto.run();
    MethodCall.run();
    Throw.run();

    try {
      UnresTest1.run();
    } catch (VerifyError ve) {
      System.out.println("Caught: " + ve);
    }
    try {
      UnresTest1.run();
    } catch (VerifyError ve) {
      System.out.println("Caught (retry): " + ve);
    }

    try {
      UnresTest2.run();
    } catch (VerifyError ve) {
      System.out.println("Caught: " + ve);
    } catch (Throwable th) {
      // We and the RI throw ClassNotFoundException, but that isn't declared so javac
      // won't let us try to catch it.
      th.printStackTrace();
    }
    InternedString.run();
  }
コード例 #3
0
 @Override
 public float getPercentageDone(final float n, final float n2, final float n3, final float n4) {
   final float n5 = n / n2 - 1.0f;
   return n3 + n4 * FloatMath.sqrt(1.0f - n5 * n5);
 }
コード例 #4
0
ファイル: AbstractPoint.java プロジェクト: progers/pythagoras
 @Override // from IPoint
 public Point rotate(float angle, Point result) {
   float x = x(), y = y();
   float sina = FloatMath.sin(angle), cosa = FloatMath.cos(angle);
   return result.set(x * cosa - y * sina, x * sina + y * cosa);
 }
コード例 #5
0
 public float distance(final float n, final float n2, final float n3, final float n4) {
   final float n5 = n3 - n;
   final float n6 = n4 - n2;
   return FloatMath.sqrt(n5 * n5 + n6 * n6);
 }