# teaching machines

## Bathroom Angles

Our bathroom gave me a math problem, and I failed. Herein I document my failure and visualize the answer I should have provided.

When we bought our home, the bathroom had carpet but no baseboard. This combination makes painting the walls difficult. As we are preparing to paint, I decided to install some baseboard. Measuring, cutting, and hammering… These seemed like things I could do.

The only gotcha is that one of the corners between walls isn’t a 90-degree angle. It’s a 45-degree chamfer. I knew that I wouldn’t be able to just put two baseboards with perpendicular ends together at this corner. I’d end up with a join like this:



with viewport
corner = [-2.3, -3]
size = [5.6, 3.3]

to board(angle, color, bend, cut)
with path()
color = color
opacity = 0.7
closed = true
with turtle()
position = :zero2
move().distance = 3
turn().degrees = bend
move().distance = 1
turn().degrees = bend
move().distance = 3 - 1 / tan(90 - cut)
turn().degrees = bend

board(0, :red, -90, 0)
board(-135, :magenta, 90, 0)

var twovilleDiv = jQuery('#twoville_cut0_back');
twovilleDiv.closest('pre').replaceWith(twovilleDiv);
document.getElementById('twoville_form_cut0_back').submit();

with viewport
corner = [-2.3, -3]
size = [5.6, 3.3]

to board(angle, color, bend, cut)
with path()
color = color
opacity = 0.7
closed = true
with turtle()
position = :zero2
move().distance = 3
turn().degrees = bend
move().distance = 1
turn().degrees = bend
move().distance = 3 - 1 / tan(90 - cut)
turn().degrees = bend

board(0, :red, -90, 0)
board(-135, :magenta, 90, 0)



The red board and magenta boards overlap, which is a physical impossibility.

I could have them meet at the front instead, like this:



with viewport
corner = [-3, -2.4]
size = [6.5, 3.8]

to board(angle, color, bend, cut)
with path()
color = color
opacity = 0.7
closed = true
with turtle()
position = :zero2
move().distance = 3
turn().degrees = bend
move().distance = 1
turn().degrees = bend
move().distance = 3 - 1 / tan(90 - cut)
turn().degrees = bend

board(0, :red, 90, 0)
board(-135, :magenta, -90, 0)

var twovilleDiv = jQuery('#twoville_cut0_front');
twovilleDiv.closest('pre').replaceWith(twovilleDiv);
document.getElementById('twoville_form_cut0_front').submit();

with viewport
corner = [-3, -2.4]
size = [6.5, 3.8]

to board(angle, color, bend, cut)
with path()
color = color
opacity = 0.7
closed = true
with turtle()
position = :zero2
move().distance = 3
turn().degrees = bend
move().distance = 1
turn().degrees = bend
move().distance = 3 - 1 / tan(90 - cut)
turn().degrees = bend

board(0, :red, 90, 0)
board(-135, :magenta, -90, 0)



But this leaves an unsightly gap, which is an aesthetic impossibility.

My intuition kicked in and told me I needed a 45-degree cut on the board that was up against the chamfer. I obeyed and unwittingly birthed a monster. The boards aligned at the ends, but the fronts didn’t match up at all.



with viewport
corner = [-2.3, -3]
size = [5.6, 3.3]

to board(angle, color, bend, cut)
with path()
color = color
opacity = 0.7
closed = true
with turtle()
position = :zero2
move().distance = 3
turn().degrees = bend
move().distance = 1
turn().degrees = bend
move().distance = 3 - 1 / tan(90 - cut)
turn().degrees = bend

board(0, :red, -90, 0)
board(-135, :magenta, 90, 45)

var twovilleDiv = jQuery('#twoville_cut45');
twovilleDiv.closest('pre').replaceWith(twovilleDiv);
document.getElementById('twoville_form_cut45').submit();

with viewport
corner = [-2.3, -3]
size = [5.6, 3.3]

to board(angle, color, bend, cut)
with path()
color = color
opacity = 0.7
closed = true
with turtle()
position = :zero2
move().distance = 3
turn().degrees = bend
move().distance = 1
turn().degrees = bend
move().distance = 3 - 1 / tan(90 - cut)
turn().degrees = bend

board(0, :red, -90, 0)
board(-135, :magenta, 90, 45)



After some reflection, I realized that I was lining up the side of a 45-degree right triangle with the hypotenuse of a 45-degree right triangle, and they would necessarily not be of the same length.

To ensure that both ends had the same length, I would need to cut each at the same angle. In this case, I needed to split those 45 degrees between the two boards, cutting each with a 22.5-degree bevel.



with viewport
corner = [-2.3, -3]
size = [5.6, 3.3]

to board(angle, color, bend, cut)
with path()
color = color
opacity = 0.7
closed = true
with turtle()
position = :zero2
move().distance = 3
turn().degrees = bend
move().distance = 1
turn().degrees = bend
move().distance = 3 - 1 / tan(90 - cut)
turn().degrees = bend

board(0, :red, -90, 22.5)
board(-135, :magenta, 90, 22.5)

var twovilleDiv = jQuery('#twoville_cut22');
twovilleDiv.closest('pre').replaceWith(twovilleDiv);
document.getElementById('twoville_form_cut22').submit();

with viewport
corner = [-2.3, -3]
size = [5.6, 3.3]

to board(angle, color, bend, cut)
with path()
color = color
opacity = 0.7
closed = true
with turtle()
position = :zero2
move().distance = 3
turn().degrees = bend
move().distance = 1
turn().degrees = bend
move().distance = 3 - 1 / tan(90 - cut)
turn().degrees = bend

board(0, :red, -90, 22.5)
board(-135, :magenta, 90, 22.5)



This looks so much better.

One of the reasons I got into computers is so that I could play around with ideas without wasting materials on my mistakes. If only I’d done so here. This is what miter been.