Here you can find the source of cos(int i)
Parameter | Description |
---|---|
i | the number, in degrees |
public static float cos(int i)
//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]; } }