asind

koadrobot/math/asind

Calculates arc sine in degree.
asind
@/asind
Calculates arc sine in degree.
INnumber
Input value in range [-1.0, 1.0]
asind
IN
DEG
DEGnumber
Result angle in degrees.
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_IN>(ctx);
    if (x<-1.0 || x>1.0)
        emitValue<output_DEG>(ctx, sqrt(-1.0));  // NaN _ nanf
        // raiseError<output_DEG>(ctx); // raise also inf
    else
        emitValue<output_DEG>(ctx, asin(x) * 57.295779513);
}

Tabular tests

INDEG
190
0.530~
-0.5-30~
-1-90~
00~
NaNNaN
InfNaN
-InfNaN
0.01745241~
-0.0174524-1~
1.1NaN
-1.1NaN