Here you can find the source of sin(final double value)
public static final double sin(final double value)
//package com.java2s; //License from project: Open Source License public class Main { private static float[] SIN_TABLE = new float[361]; public static final float sin(final float value) { //temp - crutch final int temp; if (value > 0) { if ((int) value > 360f) { if ((temp = ((int) value - ((int) (value / 360f)) * 360)) != 0) { return SIN_TABLE[temp]; } else { return SIN_TABLE[360]; }/*w w w . j av a 2s. co m*/ } else { return SIN_TABLE[(int) (value)]; } } else if ((-(int) value) > 360f) { if ((temp = (-((int) value - ((int) (value / 360f)) * 360))) != 0) { return SIN_TABLE[temp]; } else { return SIN_TABLE[360]; } } else { return SIN_TABLE[-(int) (value)]; } //return SIN_TABLE[(int)(value)];//? } public static final double sin(final double value) { final int temp; if (value > 0) { if ((int) value > 360d) { if ((temp = ((int) value - ((int) (value / 360d)) * 360)) != 0) { return (double) SIN_TABLE[temp]; } else { return (double) SIN_TABLE[360]; } } else { return (double) SIN_TABLE[(int) (value)]; } } else if ((-(int) value) > 360d) { if ((temp = (-((int) value - ((int) (value / 360d)) * 360))) != 0) { return (double) SIN_TABLE[temp]; } else { return (double) SIN_TABLE[360]; } } else { return (double) SIN_TABLE[-(int) (value)]; } //return (double)SIN_TABLE[(int)(value)]; } }