i am out of ideas; wikipedia could not help me, and so it is either a week with my nose in old math books or an embarassing question on the forums. (i choose you, pikachu!

please see attached picture; for a simple collision detection, i am trying to offset a circle (that intersects a line) out of the intersection (by moving him perpendicularly to the line). i’ve got all the formulas, but the math skills must have suffered from all the crayons up my nose.

(i came up with {CODE(ln=>0)}b = sqrt( r / m ^ 2 )+ 1 ±1)^, but it appears to be wrong.)

enlightenment, please?

edit: i did not realize that

{CODE(ln=>0)}c^2 = r^2^ (instead of r)

the correct formula is {CODE(ln=>0)}sqrt r ^ 2 )/(( m ^ 2 )+ 1 /((-m-^-2-)±1)^

… i guess.

question.png (30.6 kB)