Generate angles as SVG file

I planned to post more often about the little side projects I created in the past. This is one of them. ;)

My girlfriend is a future elementary school teacher and was preparing teaching material for her math lesson a few months ago. She had a template of a handout for a geometry lesson with several angles for the children to measure. The problem was that the lines were too thick and looked almost like tiny rectangles sticked together. The kids won't be able to accurately measure the angle because it was not obvious where to put the center of the set square.

Imprecise display of an angle

Imprecise display of an angle

This is where my idea for the CreateAngles class came from. I wrote a simple Java program to generate SVG files providing sharp and crisp angles for her handout. I chose SVG because it's based on a simple XML structure which can be created easily. The crucial part is the configuration of the line style. By adding the stroke-linejoin and stroke-miterlimit properties I was able to create sharp and pointed intersections (take a look at the line in the source code). I also added an arc indicating the angle to be measured.

Sharp and pointed angle

Sharp and pointed angles

Leave a Reply

Your email address will not be published. Required fields are marked *