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

floatcosf(float f)
Uses Math.cos, but returns the result as a float.
return (float) Math.cos(f);
floatcosf(float value)
cosf
return (float) Math.cos(value);
doublecosineCoefficient(double[] hist1, double[] hist2)
cosine Coefficient
double distance = 0;
double tmp1 = 0, tmp2 = 0;
for (int i = 0; i < hist1.length; i++) {
    distance += hist1[i] * hist2[i];
    tmp1 += hist1[i] * hist1[i];
    tmp2 += hist2[i] * hist2[i];
if (tmp1 * tmp2 > 0) {
...
floatcosineInterpolate(float y1, float y2, float mu)
cosine Interpolate
float mu2;
mu2 = (float) (1 - Math.cos(mu * Math.PI)) / 2;
return (y1 * (1 - mu2) + y2 * mu2);
doublecosineTheorem(double d12, double d23, double theta123)
For a planar triangle 1,2,3, computes d13, based on d12,d23 and theta23 = angle(d12,d23) using the cosine theorem, i.e.: d13^2 = d12^2 + d23^2 + d12 d23 cos(theta23)
return (d12 * d12 + d23 * d23 - 2 * d12 * d23 * Math.cos(theta123));
doublecosInt(double s)
cos Int
return (1.0 - Math.cos(s * Math.PI)) * 0.5;