Calculations with angle

Godot Version

4.4

Question

I cant find any informations to get into angle calculations in godot. Lets say i want to put a node 90 degrees clockwise next to another node with a magnitude (distance) of 100 pixel in 2D. Any ideas?

I’m not quite sure I understand what you are trying to achieve.
You can get a normalized vector from an angle with Vector2.from_angle which you can use to position the node:

position = other_node.position + Vector2.from_angle(PI/2) * 100

Or more general:

position = other_node.position + Vector2.from_angle([some_angle]) * [distance]

There is a great introduction to vector math in the docs:

1 Like