# How to scale a triangle such that the distance between original edges and new edges are equal?

This is very similar to this question:

Coordinates of parallel triangle with a distance of 'd' between the parallel edges?

That seems to provide the answer in 2D, but I am unsure how to apply this to 3D.

To recap the original question; I am looking to scale a triangle such that the new triangle has the same distance to the original for each edge; I also need to do so in 3D.

• Do you mean that your triangle is embedded in three dimensional space or that you need to do this for a piramid? – Aitor Ormazabal Aug 14 '15 at 19:54
• It is embedded in 3D space; basically each point has a Z value. – dmarra Aug 14 '15 at 19:59
• If the scaled triangle stay in the same plane as the original triangle than, with a suitable change of coordinates you have the same solution as in 2D. – Emilio Novati Aug 14 '15 at 20:13
• You can do exactly as in the 2d case: once you have computed incenter $I$ and scale factor $s$, then for every vertex: $A\to A'=I+s(A-I)$. – Intelligenti pauca Aug 14 '15 at 20:13
• Aretino; that worked perfectly. thank you for explaining this in a way I understand. – dmarra Aug 14 '15 at 20:50

## 2 Answers

A triangle in 3D is still a triangle, with the area $S$ and semiperimeter $\rho$, just all the points has one extra coordinate, so the solution in the cited answer is also valid. The point of the incenter is found as

\begin{align} I&=\tfrac{a}{2\rho}A+\tfrac{b}{2\rho}B+\tfrac{c}{2\rho}C, \end{align} the inradius $r=\frac{S}{\rho}$, and expression for the scaled points is the same:

\begin{align} P'= I + \frac{r+d}{r}(P-I) \end{align} for $P=A,B,C$, $P'=A',B',C'$.

* Edit * Example:

\begin{align} a&=10.6770782520313 \\ b&=13.6014705087354 \\ c&=7.68114574786861 \\ \rho&=15.9798472543177 \\ S&=40.8962100933571 \\ r&=2.55923660861696 \\ Ic&=(0.0750533703072529,5.86313622256124,0.535772095008993) \\ d&=-1 \end{align}

• Aretino's explanation did it for me, but I am marking this as the answer as well because it is valid. For programmer like me who finds math symbols a bit mystifying, P is each Vector3D, and I is also a Vector3D that symbolizes the correct center of the triangle. – dmarra Aug 14 '15 at 20:51

The final scaled triangle will be the same wether it is embedded in three dimensional space or two dimensional space. I think you mean that your triangle is defined by it's coordinates in a coordinate system, and you want to find out the coordinates of the enlarged triangle's corners.

One way to do this would be to find some 2d coordinates that define the same triangle but in 2d space, and then use the answer you linked to to find the coordinates of the enlarged triangle in 2d. Then you could calculate the incenter of the 2d triangle, and measure the distance of the enlarged triangle's corners to the incenter. Once you have this distances, you can calculate the incenter in 3d space and use the distances to determine the new triangle's corners (the line from the triangle's incenter to one of it's corners will also contain the new triangle's corner).