cos

xod/math/cos

Calculates cosine of an angle.
cos
@/cos
Calculates cosine of an angle.
RADnumber
Angle in radians.
cos
OUT
RAD
OUTnumber

C++ implementation

#pragma XOD dirtieness disable

node {
    void evaluate(Context ctx) {
        Number x = getValue<input_RAD>(ctx);
        emitValue<output_OUT>(ctx, cos(x));
    }
}

Tabular tests

RADOUT
01
1.0470.5~
-1.0470.5~
3.14-1~
1.576.123~
NaNNaN
InfNaN
-InfNaN