Java Abs absAngleDifference(double angle1Radians, double angle2Radians)

Here you can find the source of absAngleDifference(double angle1Radians, double angle2Radians)

Description

abs Angle Difference

License

Open Source License

Declaration

public static double absAngleDifference(double angle1Radians,
            double angle2Radians) 

Method Source Code

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

public class Main {
    public static final double PI2 = Math.PI * 2;

    public static double absAngleDifference(double angle1Radians,
            double angle2Radians) {
        double diff = angle1Radians - angle2Radians;
        while (diff > Math.PI)
            diff -= PI2;/*from ww  w  .ja v a 2 s  .c  om*/
        while (diff < -Math.PI)
            diff += PI2;

        return Math.abs(diff);
    }
}

Related

  1. abs(short x)
  2. abs2(double[][] IN)
  3. abs2(float[] f)
  4. abs_fractional(double number)
  5. abs_min(double a, double b)
  6. absApproximation(double x, double M)
  7. absCap(double value, double bounds)
  8. absClamp(double value, double bounds)
  9. absDegrees(double degrees)