Trigonometry
Related terms: sine, cosine, tangent, radians
The relationship between angles and lengths. On a unit circle, an angle θ measured from the positive X axis gives the point (cos(θ), sin(θ)). Cosine gives X; sine gives Y.
Multiply both by a radius to orbit a pickup or place enemies around a ring. Sine also makes repeating motion, such as bobbing. This diagram uses Y pointing up; screen coordinates may point down.
point = center + radius * (cos(t), sin(t))
- Further reading
- Khan Academy: Unit circle trigonometry