[Math] Incenter of Triangle in 3D

3dcirclesgeometrytriangles

I'm trying to figure out how to find the incenter of a triangle with (x, y, z) coordinates for the verteces.

I can find the lengths of the sides and the radius of the incircle from that, so I've conidered using vector math to get to the midpoint of a side and then make a vector from there to the opposite vertex and traverse that vector a distance of the radius of the incircle to arrive at the incenter.

Am I on the right track?

Is there a formula for this in terms of vectors or x, y, z coordinates?

I'd rather not have to do coordinate transformations to and from 2D if possible.

Thanks!

Best Answer

The incenter has trilinear coordinates $1:1:1$, which you can convert to barycentric coordinates $a:b:c$, where $a=\lVert B-C\rVert, b=\lVert C-A\rVert, c=\lVert A-B\rVert$ are the edge lengths of the triangle. The incenter therefore has coordinates

$$\frac{a}{a+b+c}A + \frac{b}{a+b+c}B + \frac{c}{a+b+c}C$$

no matter the dimension of the space where these corners $A,B,C$ live.

[…] get to the midpoint of a side and then make a vector from there to the opposite vertex […]

That won't work. As Blue already pointed out in a comment, the incircle center won't lie on that median. If you want to start with the computed incircle radius, you could take a line parallel to the edge but shifted by the given distance into the direction of the other edge, and do so for two edges. But the above is much simpler.

The centroid does lie on the medians, but for that you'd simply intersect two medians and you don't get a reasonable circle associated with that triangle center.