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.

Hint : find the angular coefficient of the line between the points $A$ and $B$ $\left( m = \frac{A_y-B_y}{A_x-B_x}\right)$ and $q$ (where the line crosses the y-axis), and solve the system of the equation of the circle and the line, letting $\Delta = 0$. Let $(C_x,C_y)$ be the centre of the circle, and $r$ its radius...
\begin{cases} (x-C_x)^2+(y-C_y)^2=r^2 \\ y=mx+q \\ \end{cases} Let $\Delta = 0$, because if $\Delta \gt 0$ there are 2 solutions $\to$ there are 2 common points between the line and the circle, otherwise $\Delta \lt 0$ there are no intersections.