I haven’t on clue on that specifically. I know I’ve used atan2 for rotating 2d objects, in the past.
Perhaps if you talk about what you’re after, people could offer suggestions. Unless, of course, you have to do it that way (?), in which case, I’ll just let someone else answer
This question would only make sense if all you had was a sledgehammer and you needed to figure out how to hang a door using only a sledgehammer.
Is there some reason you’re restricted to just atan?
Or are you just assuming you need atan?
If you’re just assuming you need it… well, you don’t know how to do it, so why make that assumption? Instead how about you ask “How do I hang a door?” or rather “How do I rotate an object based on the inputs from a user?” And then go into detail of what outcome you expect, rather than stabbing at the possible functions/tools you’d use to accomplish it.
There’s not a lot we can do to help if you don’t tell us what you want to accomplish.
Atan & Atan2 are Inverse Trigonometry functions for calculating angles from slope - so probably not quite what you want here. Perhaps this is what you’re after?