Java Utililty Methods cos

List of utility methods to do cos

Description

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

Method

doublecos(double a)
Returns the trigonometric cosine of an angle.
return Math.cos(a);
doublecos(double anAngle)
Returns the cos of the given angle in degrees.
return Math.cos(Math.toRadians(anAngle));
doublecos(double d)
cos
return SIN_TABLE[(int) ((float) d * 10430.378F + 16384.0F) & 65535];
doublecos(double radians)
Get the cosine of an angle
return sin(radians + Math.PI / 2);
doublecos(double[] v1, double[] v2)
cos
double s = 0;
s = multiple(v1, v2);
double a = Math.pow(multiple(v1, v1) * multiple(v2, v2), 0.5);
return s / a;
doublecos(double[] v1, double[] v2)
cos
double s = 0;
s = Math.abs(multiple(v1, v2));
double a = Math.pow(multiple(v1, v1) * multiple(v2, v2), 0.5);
if (a == 0) {
    return -1.0;
return s / a;
doublecos(final double value)
cos
final int temp;
if (value > 0) {
    if ((int) value > 360d) {
        if ((temp = ((int) value - ((int) (value / 360d)) * 360)) != 0) {
            return (double) COS_TABLE[temp];
        } else {
            return (double) COS_TABLE[360];
    } else {
        return (double) COS_TABLE[(int) (value)];
} else if ((-(int) value) > 360d) {
    if ((temp = (-((int) value - ((int) (value / 360d)) * 360))) != 0) {
        return (double) COS_TABLE[temp];
    } else {
        return (double) COS_TABLE[360];
} else {
    return (double) COS_TABLE[-(int) (value)];
floatcos(final float angle)
Faster cos method using special cache, based on Mojang code.
return sinCache[((int) ((angle * UNKNOWN_CONST) + ((SIN_CACHE_SIZE + 1) / 4)) & SIN_CACHE_SIZE)];
floatcos(final float value)
cos looked up in the sin table with the appropriate offset
return SIN_TABLE[(int) (value * 10430.378F + 16384.0F) & 65535];
floatcos(float angle)
cos
return (float) Math.cos(angle);