You can put this solution on YOUR website! That's true. Do you have a question (you did not ask one, so there is no "answer"). I guess if you want to solve for r you have
but that's nearly all the answer I can give you. Or I could go on to proving that formula using calculus if your question asks so...