Java sin sin(float angle)

Here you can find the source of sin(float angle)

Description

sin

License

Open Source License

Declaration

public static float sin(float angle) 

Method Source Code

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

public class Main {
    private final static int accuracy_level = 65536;
    private static float[] sin_table = new float[accuracy_level];
    private final static float PI = (float) Math.PI;

    public static float sin(float angle) {
        float angle1 = angle % (2 * PI);
        if (angle1 < 0) {
            angle1 += 2 * PI;//  w w  w  .j ava2  s.co m
        }
        return sin_table[(int) (angle1 * accuracy_level / 2 / PI)];
    }
}

Related

  1. sin(double radians)
  2. sin(double... v)
  3. sin(final double value)
  4. sin(final float angle)
  5. sin(float angle)
  6. sin(float n)
  7. sin(int angle)
  8. sin(int angle)
  9. sin(int f)