# Retrieve rotation angle with Geometry Nodes

With Geometry Nodes I move the rotation angle Z of an object with a function.

And I need to know if the angle of rotation Z is nearly to zero before applying the new value in the node 'Transform'.

Depending on the angle I want to apply 'function 1' or 'function 2' to the rotation angle in the node 'transform'.

How can I retrieve the rotation angle Z to compare it directly in 'Compare Rotation Z'?

Thanks again

• That depends on how you implemented the rotation on Z. Since it seems you are doing some kind of calculation with this function you somehow have to get the result from it to plug it into some rotation node to make the object rotate...? So if you output the result somewhere, you can use this to compare it? If not, where is the problem with that? Mar 6, 2023 at 9:53
• I don't really understand what the problem is. Your function gives you a float value, that you want to compare to 0. So do that - connect the output of the function to Compare or Math node and enter the second value of 0. You can connect the same output to multiple inputs. Example Mar 6, 2023 at 12:00
• Okay, I see why there might be a problem if I understand the question correctly. But if I do then this makes no real sense at first glance. As I understand it, you want to know the Z rotation which is plugged into the Transform node and compare it to 0. But the result of the comparison should drive the switch as to which function will provide the Z value - this produces a circular reference error because you have a closed loop. Let's say function 1 gives 0, and function 2 gives 1. Mar 6, 2023 at 12:20
• If the output of the switch and therefore the Z rotation would come from function 1, the angle would be 0, then the compare node would be true and switch to function 2, but then the angle would be 1, so the compare node results in false and switching back to function 1. This does not work, because the result of the switch depends on the condition of the compare node which depends on the result of the switch. This is nonsense. Mar 6, 2023 at 12:25
• So I guess what you really want to do is comparing the result of function 1 and 2 against 0, and if any of them is close to 0, you want the switch to use the value of the other function to be used for the Z rotation. Then you only have to compare the float value of a function to 0 and switch between both functions accordingly. But the way how to set this up depends a lot on what you want to switch to if a) both are close to 0 or b) none of them are 0. Is the value of function 1 or 2 preferred over the other? Mar 6, 2023 at 12:48