Alright, I am programming a plugin for a game that requires me to get the closest point on a circle when all you have is a point B, which is outside of the circle, the radius of the circle, and the location of the center of the circle.
Say I have this situation:
So, how would I be able to get the coordinates of point C? I need a formula that allows me to calculate those coordinates when I only know the radius of the circle and the coordinates of B. I sketched the line for ease of understanding, but all I start with is just the circle and point B. OH, one other thing, B isn't a static point, each time this calculation will be executed B will be at another position.
And, as a bonus (not really needed) would you care to show an example on how to do the same thing, but then when point B is inside the circle.
Thanks in advance!