Imperial's answer works fine if you are in a game engine that has the normalise() function, but if you are doing something a bit more homebrew, the actual math works like this:
Since both points are an object with a known X, Y, and radius value, you can use your basic slope formula tells us Slope=(Y2-Y1)/(X2-X1)
We also know that both objects will follow this slope over the distance of their radius at which point you are left with something like this to find your X: https://math.stackexchange.com/questions/566029/in-a-right-triangle-given-slope-and-length-of-hypotenuse-find-length-of-legs
With two known legs on a right triangle, the Y is just a simple pythagorean function equation.
Lastly, you need to check the directions of your rise and run because all that Squaring only produces positive values.
So what this would look like in a language agnostic since is something like this:
getCloser(target){
rise = target.y-this.y;
run = target.x-this.x;
slope = rise/run;
movX = this.radius/sqrt(slope^2+1);
movY = sqrt(this.radius^2-movX^2);
if (run > 0){
this.x += movX;
} else {
this.x -= movX;
}
if (rise > 0){
this.y += movY;
}else{
this.y -= movY;
}
}
then
point1.getCloser(point2);
point2.getCloser(point1);