Here you can find the source of sin(int i)
Parameter | Description |
---|---|
i | the number, in degrees |
public static float sin(int i)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w w w .ja v a 2s. c om * Table of sine values * * @see #COS_TABLE */ private static final float[] SIN_TABLE = new float[360]; /** * Returns the sine of i * * @param i the number, in degrees * @return the sine of i * @see #cos(int) */ public static float sin(int i) { for (/**/; i >= 360; i -= 360) { } for (/**/; i < 0; i += 360) { } return SIN_TABLE[i]; } }