1
$\begingroup$

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.

enter image description here

$\endgroup$
1
$\begingroup$

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)$$

$\endgroup$
  • $\begingroup$ are A and B those intersecting points? I can calculate the distance apart for those little pieces in between the circle to the point of the rectangle, but I'm not sure about the coordinates because the cut can be made at an angle $\endgroup$ – Masterminder Mar 9 '14 at 17:50
  • $\begingroup$ $A$ and $B$ are the coordinates of the two intersection points. The other points of the rectangle are given by $A' = A+O$ and $B'=B+O$, all the points are two-coordinate vectors and $\Vert P \Vert = \sqrt{P_1^2+P_2^2}$. The Angle of $\overline{AB}$ is irrelevant to the question. $\endgroup$ – AlexR Mar 9 '14 at 17:52
  • $\begingroup$ so A' and B' would be the two co-ordinates on the blue line correct from my understanding? $\endgroup$ – Masterminder Mar 9 '14 at 18:00
  • $\begingroup$ @Masterminder No, $A'$ and $B'$ will be the corners of the rectangle not on the circle (Green). $A$ and $B$ are the red-circled points in your sketch. $\endgroup$ – AlexR Mar 9 '14 at 18:02
  • $\begingroup$ Yes but they will lie on the blue line correct? The line divides the circle and those rectangles start where the blue line is. Do you know what I mean? $\endgroup$ – Masterminder Mar 9 '14 at 18:07
0
$\begingroup$

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.

$\endgroup$
-1
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.