How to find location of a point for a rectangle I have a circle with a line that is drawn through it at two points. I have the coordinate for the center of the circle, the two coordinates where it intersects the circle and the radius as well. I want to put the two rectangles around the two pieces from the circle, as shown by the green marking. My question is how can I get the coordinates of the rectangle? Any help would be appreciated

One of the things i considered using was the midpoint formula to find the middle coordinate between the intercepting points and then I can find the distance.
Assuming the center to be the origin, compute $r-\Big\Vert \frac{A+B}2 \Big\Vert$. This is the amount of offset needed. The direction is given by $\frac{A+B}2$, so the complete formula is
$$O = \frac{r-\left\Vert\frac{A+B}2\right\Vert}{\left\Vert\frac{A+B}2\right\Vert} \frac{A+B}2 = \frac{2r - \Vert A+B\Vert}{2\Vert A+B\Vert} (A+B)$$
Find equation of the blue line and that of the circle(shift origin here or it will get a bit nasty) and add an arbitrary constant to it and put in equation of circle retaining only x terms.

You will get a quadratic equation. Set discriminant to be 0 as you want only 1 point of contact with circle(tangent)

Knowing this point, You can find its equation and equation of other lines as you know their slopes/points. You will get 2 values of arbitrary constants up there corresponding to 2 rectangles.