Radius of in-circle as a function of the center

120 Views Asked by At

I am trying to find the radius of an in-circle in a random triangle as a function of the center of the circle. Let (x,y) in\R^2 be the center of a circle, r the radius then i need an expression of the form r(x,y). The cirle does not have to touch all three sides of the triangle, but it has to touch at least one. I find it difficult to get started, so all help will be appreciated.

1

There are 1 best solutions below

1
On BEST ANSWER

The $r$ you want is the minimum of the distances to the 3 lines defining the triangle.

The distance of a point $p := (x,y)$ to a line $L := a x + b y + c = 0$ is given by:

$$d(p,L) = \frac{\left| a x + by + c\right|}{\sqrt{a^2+b^2}}$$

If your line $L$ is defined by two points $(x_1,y_1)$, $(x_2,y_2)$ on it, then points $(\tilde{x},\tilde{y})$ on $L$ satsify:

$$\det\begin{bmatrix}\tilde{x} & \tilde{y} & 1\\x_1 & y_1 & 1\\x_2 & y_2 & 1\end{bmatrix} = 0 \quad\implies\quad d(p,L) = \frac{\left|\det\begin{bmatrix}x & y & 1\\x_1 & y_1 & 1\\x_2 & y_2 & 1\end{bmatrix}\right|}{\sqrt{(x_1-x_2)^2+(y_1-y_2)^2}} $$