We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Given the x,y, and radius of a circle, and given a point inside the circle, how can I find the closest point on the circle to my point without brute forcing? Is there a way?
Found my answer here:
double vX = pX - cX;
double vY = pY - cY;
double magV = sqrt(vX*vX + vY*vY);
double aX = cX + vX / magV * R;
double aY = cY + vY / magV * R;