Here you can find the source of sin5(float x)
public static float sin5(float x)
//package com.java2s; /******************************************************************** Copyright (c) 2000-2008 Steven E. Hugg.// w w w .j ava2 s . c om This file is part of Exoflight. Exoflight is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Exoflight is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Exoflight. If not, see <http://www.gnu.org/licenses/>. *********************************************************************/ public class Main { /** * 5th order Taylor series approx of sin(x) * only valid from about -pi < x < pi */ public static float sin5(float x) { float x2 = x * x; return x * (x2 * x2 - 20 * x2 + 120) / 120; } }