Android Trigonometric Functions arctan(float opp, float adj)

Here you can find the source of arctan(float opp, float adj)

Description

Get the desired angle of ARCTAN from the given opp and adj

Declaration

public static float arctan(float opp, float adj) 

Method Source Code

//package com.java2s;

public class Main {
    /**//from   w  w  w . 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 value)
  2. cos(float degree)
  3. cosf(float degree)
  4. cosr(float radians)