# Practical Problem: mitering corners

1. May 21, 2006

### Lyle McElhaney

This is a math problem that has application in graphics. Suppose you have a pair of rectangular shapes in 2D that are designed to meet along their short edges and you want to provide a smooth, mitered joining. The rectangles, of the same width, can meet at any angle (imagine mitering a couple of pieces of wood trim so they meet neatly at natural corners). Define one of the rectangles as the leading rectangle, the other as trailing; the angles are measured wrt a side of the trailinging edge rectangle. The angle of meeting is zero if the meet head-to-head, and the mitering angle is 90 degrees. If they meet at right angles, then the mitering angle is 45 degrees. The meeting angle can be anywhere from, say, -170 degrees to 0 (head-to-head) to 170 degrees on the other side, avoiding the problems of a 180 degree meeting. All well and good; the mitering angle is always 1/2 of the meeting angle.

Now, widen the assumptions so the two rectangles can have different widths, defined by a ratio of the leading side width to the trailing side width. It's possible for them to still meet in a neat miter (as long as the angle is not so near zero as to give the sides no where to intersect; ignore this possibility by ignoring meeting angles between, say, 5 degrees and -5 degrees). OK, given the meeting angle (+/- 170 <= ma <= +/- 5) and the ratio of the widths, what is the mitering angle (the angle that will cut the rectangular ends to allow them to meet evenly at the same length on both sides)? More correctly, what is the formula for the angle given the meeting angle and the ratio?

Holding the angle steady (at, say, 45 degrees) and varying the ratio shows that at the limits (ratio == 0 and infinity) the miter angle moves through an angle of 180 degrees - the meeting angle. A graphical interpretation of that is enclosed.

Help on this would be appreciated; I have a linear approximation, but the angle is definitely non-linear, and I would like to get as exact an answer as I can. I have been unable to find anything on the net that approaches this problem.

(I note, with embarrassment, an error in the drawing I made . The limit of b in the third case is a, not 90-a.)

#### Attached Files:

• ###### miter1.gif
File size:
9.7 KB
Views:
83
Last edited: May 21, 2006