Java acos acos(int f)

Here you can find the source of acos(int f)

Description

acos

License

Artistic License

Declaration

public static int acos(int f) 

Method Source Code

//package com.java2s;
/*/*from w  w w.ja va 2 s.c  o  m*/
    
 FP version 3.1
    
 Copyright (c) 2004 Andre de Leiradella <leiradella@bigfoot.com>
    
 This program is licensed under the Artistic License.
    
 See http://www.opensource.org/licenses/artistic-license.html for details.
    
 Uses parts or ideas from FPMath. FPMath is copyright (c) 2001 Beartronics and
 is authored by Henry Minsky.
 http://bearlib.sourceforge.net/
    
 Uses parts or ideas from oMathFP. oMathFP is copyright (c) 2004 Dan Carter.
 http://orbisstudios.com/
    
 */

public class Main {
    public static int acos(int f) {
        return (102943 - asin(f));
    }

    public static int asin(int f) {
        boolean neg;
        if (neg = f < 0)
            f = -f;
        int g = ((int) (102943 - ((((long) sqrt((65536 - f))) * (((((long) f)
                * (((((long) f) * (((((long) f) * ((long) -1228)) >> 16) + 4866)) >> 16) - 13900)) >> 16)
                + 102939)) >> 16)));
        return neg ? -g : g;
    }

    public static float sqrt(float f) {
        return -1;
    }
}

Related

  1. acos(final float a)
  2. acos(float value)
  3. acos(float value)
  4. acos(float value)
  5. acos(float x)
  6. acos(Integer a)
  7. acos(Long a)
  8. acos(Number x)
  9. acos_v2(double x)