tand

koadrobot/math/tand

Calculates tanjant in degree.
tand
@/tand
Calculates tanjant in degree.
DEGnumber
Angle in degrees.
tand
OUT
DEG
OUTnumber
To use the node in your project you should have the koadrobot/math library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

#pragma XOD dirtieness disable

struct State {
};

{{ GENERATED_CODE }}

void evaluate(Context ctx)
{
    Number x = getValue<input_DEG>(ctx);
    if (x==90.0 || x==270.0)
        emitValue<output_OUT>(ctx, sqrt(-1.0));  // NaN _ nanf
        // raiseError<output_OUT>(ctx);
    else
        emitValue<output_OUT>(ctx, tan(x * 0.01745329252));
}

Tabular tests

DEGOUT
00
300.577350~
-30-0.577350~
1800~
90NaN
NaNNaN
InfNaN
-InfNaN
3600~
270NaN
10.0174550~
3610.0174550~
8957.289961~
91-57.289961~
-89-57.289961~
-1-0.0174550~