#### Tsa05

##### Member

Simply, I didn't learn the proper terminology when I should have. Blah blah public school systems, anyways... while trigonometry concepts have become ever-increasingly clear to me on account of programming, it's plausible that I just simply haven't the knowledge of what to "google" in the jargon sense to find what I want. Surely, someone's drawn a triangle with rounded corners before. Surely.

But googling variations on "program draw rounded triangle" provides tutorials on photoshop, illustrator, gimp, powerpoint....and maths demos of how to draw triangles with rounded *sides* or fitted inside of circles. This is maddening, so I've re-invented the 3-sided wheel here, since my google doesn't seem to know where the solution is.

Problem is, I've never been particularly good at re-inventing branches of maths. Whenever I do, I promptly discover that someone else already did it, but faster, cheaper, and more accurately. I'm feeling up for a good round of derisive laughter today, so here's what I came up with last evening:

I've kept the alpha low so that you can see the construction. At 100% opacity, this draws a smooth rounded triangle with variable-radius corners. It also draws 9 triangles because it's all I've got.

Is there some way to know all of the "tangents that are on the outside?"

Current method:

1) Draw 3 circles

2) Compute the common tangent between circle one and circle two

3) Draw a triangle from a tangent point on C1 to the corresponding tangent point on C2 to C3's origin

See how this makes a nice tangent from c1 to c2?

4) But, I don't know which common tangent is "to the outside," so I draw both:

5) But, there's a gap created in the drawing near C1, due to the radius and severity of angles, so I draw a third triangle from each tangent point on C1 over to the midpoint of C2 and C3:

So, that's C1 to C2 solved.

Repeat these computations for C2-C3 and C3-C1, resulting in the first picture I posted.

There's not, I admit, a ton of room for discussion, but basically:

A) Is this...right? Are there better math ways to compute this to permit drawing only the correct tangent? (Not a discussion point, this, but a factual correction desired)

b) Is this...wise? Drawing 9 triangles and 3 circles isn't expensive, but would people use this method? Are there other methods you'd prefer to draw this kind of geometry? (Discussion hopefully possible)