Android Trigonometric Functions arctan(float value)

Here you can find the source of arctan(float value)

Description

arctan

Declaration

public static float arctan(float value) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*from w ww  .  j  a  v a2 s  . co m*/
     * Convert Radians to Degrees.
     */
    public static final float TO_DEGREES = 57.2957795f;

    /**
     * Get the desired angle of ARCTAN from the given opp and adj
     */
    public static float arctan(float opp, float adj) {
        if (adj < 0.0)
            return -(float) (Math.atan(opp / adj) * TO_DEGREES);
        else
            return -(float) (Math.atan(opp / adj) * TO_DEGREES) + 180;
    }

    /**
     * 
     */
    public static float arctan(float value) {
        return -(float) (Math.atan(value) * TO_DEGREES) + 180;
    }
}

Related

  1. arctan(float opp, float adj)
  2. cos(float degree)
  3. cosf(float degree)
  4. cosr(float radians)
  5. sin(float degree)