Java Utililty Methods sin

List of utility methods to do sin

Description

The list of methods to do sin are organized into topic(s).

Method

doublesin(double a)
Returns the trigonometric sine of an angle.
return Math.sin(a);
doublesin(double anAngle)
Returns the sign of the given angle in degrees.
return Math.sin(Math.toRadians(anAngle));
doublesin(double d)
sin
return SIN_TABLE[(int) ((float) d * 10430.378F) & 65535];
doublesin(double radians)
Get the sine of an angle
radians = reduceSinAngle(radians); 
if (Math.abs(radians) <= Math.PI / 4) {
    return Math.sin(radians);
} else {
    return Math.cos(Math.PI / 2 - radians);
double[]sin(double... v)
sin
double[] r = new double[v.length];
for (int i = 0; i < v.length; i++)
    r[i] = Math.sin(v[i]);
return r;
doublesin(final double value)
sin
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)];
floatsin(final float angle)
Faster sin method using special cache, based on Mojang code.
return sinCache[((int) (angle * UNKNOWN_CONST) & SIN_CACHE_SIZE)];
floatsin(float angle)
sin
return (float) Math.sin(angle);
floatsin(float angle)
sin
float angle1 = angle % (2 * PI);
if (angle1 < 0) {
    angle1 += 2 * PI;
return sin_table[(int) (angle1 * accuracy_level / 2 / PI)];
floatsin(float n)
sin
return sin[(int) (n * 10430.378F) & 0xffff];