# Round the angle of a triangle with a specific radius

I have three known points defining a triangle: $A(x_a,y_a), B(x_b,y_b)$ and $C(x_c,y_c)$.
How do I round the angle (ABC) of a specific radius $r$?

I know that the slope of $AB$ edge is: $(y_a - y_b) / ( x_a - x_b)$.

My circle with center (unknown) $O:(x_o, y_o)$ will have an equation $(y_a - y_o)^2 + (x_a -x_o) = r^2$.

The point $B$ will also satisfy the equation of the circle.

Knowing the slopes of the line equations of my triangle and that my circle has a radius of known $r$, I have troubles to find the center of my circle and the points $M,N$ where my circle will intersect with the edges of the triangle. The points $M,N$ are also the tangential points of the circle.

After working little the math it seems that I have too many unknowns for my system.

I would really appreciate any help.

Kind regards

• What is the meaning of "round the angle" ? Do you want to find the equation of the circumcircle of this triangle ? In other words, do you wish to find the equation of the circle passing through all the three points ? – Vishnu V.S Dec 19 '16 at 17:40
• I believe OP wants a circle passing through points $A$ and $B$ (since the circle eqn given is satisfied by $A$, and OP says that point $B$ will satisfy it too). But I think that OP wants simply to have a circle of radius $r$ passing through these two points. – John Hughes Dec 19 '16 at 17:47
• @JohnHughes Then why was $C$ even mentioned in the question ? – Vishnu V.S Dec 19 '16 at 17:49
• Because not every questioner can abstract a problem perfectly. My best guess is that OP wants the "arc" to be on the side away from $C$, and that's what I've provided in my answer, but only OP knows. – John Hughes Dec 19 '16 at 17:55

## 2 Answers

The general equation for a circle is :

$$x^2 + y^2+2gx+2fy+c=0$$

And all three points will satisfy this equation.

Hence :

$$x_a^2+y_a^2+2gx_a+2fy_a+c=0$$ $$x_b^2+y_b^2+2gx_b+2fy_b+c=0$$ $$x_c^2+y_c^2+2gx_c+2fy_c+c=0$$

You have three equations and three unknowns $f,g,c$. Solve them together to get the values and substitute them in the equation of the circle to get its equation.

I think that what you want is a circle arc passing through $AB$, having radius $r$, and with the "bump" of the arc on the side opposite $C$.

Here's a way to do that:

h = dist(A,B)/2   // compute half the distance from A to B
if (h < r) then ERROR // no radius-r circle can pass through
// points farther apart than 2r!
s = sqrt(r*r - h*h)   // Distance by which to offset circle
ux = Bx - Ax      // Ax denotes the x coord of point A
uy = By - Ay
w = sqrt(ux*ux + uy*uy)
ux = ux/w
uy = uy/w       // (ux, uy) is now a length-1 vector from A towards B

vx = Cx - Ax
vy = Cy - Ay
// Note that (-uy, ux) is a length 1 vector perpendicular to AB
// We check whether this points in the same halfspace as AC,
// or the opposite one.
dot = (-uy) * vx + ux * vy
if (dot > 0) then s = -s

Mx = (Ax + Bx)/2
My = (Ay + By)/2  // coordinates of midpoint of edge AB
Qx = Mx + s* (-uy)
Qy = My + s * ux  // Q is the center of the desired circle.
// computed by offsetting the edge midpoint
// by distance s along the vector (-uy, ux)