Java cos cos(int i)

Here you can find the source of cos(int i)

Description

Returns the cosine of i

License

Open Source License

Parameter

Parameter Description
i the number, in degrees

Return

the cosine of i

Declaration

public static float cos(int i) 

Method Source Code

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

public class Main {
    /**//from   w  ww.jav  a2 s . com
     * Table of cosine values
     *
     * @see #SIN_TABLE
     */
    private static final float[] COS_TABLE = new float[360];

    /**
     * Returns the cosine of i
     *
     * @param i the number, in degrees
     * @return the cosine of i
     * @see #sin(int)
     */
    public static float cos(int i) {
        for (/**/; i >= 360; i -= 360) {

        }
        for (/**/; i < 0; i += 360) {

        }
        return COS_TABLE[i];
    }
}

Related

  1. cos(float angle)
  2. cos(float f)
  3. cos(int angle)
  4. cos(int angle)
  5. cos(int f)
  6. cos(Integer a)
  7. cos(Long a)
  8. cosd(double degreeAngle)
  9. cosd(double x)