How to move a point (x,y) to a new position (p,q) at a specified distance and angle in 2D space?
I am working on a 2D game where I need to move a point-sized object from its current position (x, y)
to a new position (p, q)
. The new position should be exactly d
units away from (x, y)
in a specified direction given by an angle a
(in degrees or radians).