Java atan atanAlternative(double y, double x)

Here you can find the source of atanAlternative(double y, double x)

Description

atan Alternative

License

Apache License

Declaration

private static double atanAlternative(double y, double x) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    private final static double piHalf = Math.PI / 2;

    private static double atanAlternative(double y, double x) {
        if (x == 0) {
            if (y < 0) {
                return -piHalf;
            } else {
                return piHalf;
            }//w ww  .  j a v a2 s.  co m
        }
        return Math.atan(y / x);
    }
}

Related

  1. atan(int f)
  2. atan(Integer a)
  3. atan(Number x)
  4. atan_66s(double x)
  5. atan_mag1(double x)
  6. atanD(final double arg)