Tag Info

Hot answers tagged

7

Calculate a vector from B to A, normalize it (divide by the vector's length), then multiply by the circle size: vx = A.x - B.x vy = A.y - B.y length = sqrt(vx*vx + vy*vy) C.x = vx / length * size + A.x C.y = vy / length * size + A.y For the angle you can use the atan2 function, if your language has it.


2

to complete the answer: angle = atan2((C-A).y, (C-A).x) + PI/2;



Only top voted, non community-wiki answers of a minimum length are eligible