Using the Companion, apply Do It to each block starting from the top down, working from right to left, to trace all the values going into each operation, to isolate where the NaN occurs.
I see 2 possibilities:
division by 0, or
acos of a number outside the range (-1 to 1).
P.S.
Please download and post each of those event block(s)/procedures here ...
(sample video)
P.P.S.
Trashing the input to a block destroys the debugging trail. It's like muddying the footprints at a crime scene. Use separate variable for input and output at each stage, so they will be untouched for later examination.
Also, switching your formula blocks from inline to external sockets will reveal their nesting, in case you made a mistake assembling your formula.
P.P.P.S
By the way, you are dealing with floating point numbers, which are inexact. So even if your formulas are perfect, they might be producing an input to acos() (which you don't show) with an absolute value a tiny amount over 1, say -1.000000000001, beyond what AI2 might be rounding. That would not be the fault of the acos() function.
"division by 0" no because neither sin(100) nor cos(50) are 0.
"acos of a number outside the range (-1 to 1)" as I said, the value showed in label1 was -1.0.
For your answer I did a formatting as decimal number with 20 decimal places, and I saw some extra figures at the end, that caused the acos NaN response.
"switching your formula blocks from inline to external sockets" I do not know what external sockets are.
I wonder why a simple school calculator does not have this problem. I would like to read about floating point precission in AI2 but I did not find documentation.
Thanks a lot for providing this explanation to the issue.
Regards.