I don't know how to do that using trigonometry like yours, but here's a pretty simple way - you put the circle in the center, then move it towards the end and top of the box, all within the same tick.
PS: Deadeye is right, I think - it might be simplest to just place image points at all four corners and use those.