Java Angle Difference angleDif(float a, float b)

Here you can find the source of angleDif(float a, float b)

Description

angle Dif

License

Open Source License

Declaration

public static float angleDif(float a, float b) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static final float PI = (float) Math.PI;

    public static float angleDif(float a, float b) {
        if (b > a)
            return b - a > PI ? (float) (a + 2 * PI - b) : b - a;
        return a - b > PI ? (float) (b + 2 * PI - a) : a - b;
    }/*from w  ww  .  j  a  v a 2 s  .c  om*/
}

Related

  1. angleDif(double a1, double a2)
  2. angleDif(float a1, float a2)
  3. angleDiff(double a, double b)
  4. angleDiff(double alpha, double beta)
  5. angleDiff(double angle1, double angle2, boolean normalized)