Java Utililty Methods tan

List of utility methods to do tan

Description

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

Method

doubletand(double x)
tand
return Math.tan(x * (Math.PI / 180.0));
floattanf(float f)
Uses Math.tan, but returns the result as a float.
return (float) Math.tan(f);
doubletanh(double x)
tanh
return sinh(x) / cosh(x);
doubletanh(double x)
A function that returns the hyperbolic tangent of its argument.
double absX = Math.abs(x);
if (absX > 22.0) {
    return (x > 0.0) ? 1.0 : -1.0;
} else if (absX > 1.0e-6) {
    double expX = Math.exp(x);
    double expMX = Math.exp(-x);
    return (expX - expMX) / (expX + expMX);
} else {
...