Actually I was, at the time, a (high)school kid.

This was indeed the basic idea which led to the formula. The only thing left needed to complete the formula is the adjacent side which is determined by tan which in turn is determined by a.

The link provided by Plato in the post above me leads to a webpage/formula which is known to me. While it does the same, it is different from mine as I didn't use any circles or radius, though I have a strong feeling this formula could easily be deviated from the one in the link, since r and R are essentially the same as the adjacent and hypotenuse from the right triangles. But even if it is, could this be seen as an original formula?

I'm not sure how to take this, but for convenience I'll take it as a compliment