I’m trying to input degree angles in function.
I convert the value to radians ( rad= deg/180 *pi).
It seems to work correctly when the result is used as input for a cosine node, but not for a sine.
As shown in the picture, cosine gives me “expected results” when passing from 0° to 180° ( white, grey, black, well… at 180° I’m expecting -1 as result, so a black color will be right… but I have white) but I can’t say the same things for the sine node…
Ok… I’ve found the answer by myself…
The sine and cosine nodes have a default period = 1.
To obtain usual “geometric” values it needs to be changed to 2pi…
With this adjustment all the values are correct.
Ah, trigonometry… old friend
It said the input is in radians (as you would expect), but as other have stated before, it seems to be in radians/PI. Meaning an input of 1 is actually an input of PI radians…
Fix documentation, or fix the input type of the sine node please,
The issue is that he sin and cosign where not designed as the normal maths functions but rather as outputs to generate waveforms. Hence they go 0-1 to -1 to +1
So you have to map 0-360 => 0-1 so simply divide by 360.
However as the input is -180 to 180 you have to adjust for that first (if -ve add 360)
If dealing in radians one circle = 2pi radians so you have to divide by 2pi