Move a point toward the mouse
问题 (I'm using processing for this but it is not necessarily relevant.) I'm looking for an algorithm that would take the point A and the point B (B being the mouse cursor position) and use them so that every frame the point A moves a little bit towards B (from -1px to 1px left/right up/down) I tried x1 += cos(atan((mouseY-y1)/(mouseX-x1))) and the same with sin for y1, but I doesn't seem to work. If someone has an idea I would appreciate it. I'm not looking for a built-in function that would do