This word, but is there any way to streamline it?
I was able to make the code more readable and concise by use temporary variables for the equations for the lines. But I’m trying to remember if there are abbreviations I could use with pattern-matching which would be even simpler.
G6a. Using temporary variables to hold the line equations.nb (38.6 KB)
Since I have to solve for the intersection of the inset lines, I decided it was simpler to have another equation for the inset lines. This involves also finding the sign for the orientation of the triangle, since otherwise the inset lines won’t always be inside.
I know that there are simpler ways of scaling a polygon, but here I want the inset to be by a fixed amount, not a proportion of the distance to the center.
Since I have to solve for the intersection of the inset lines, I decided it was simpler to have another equation for the inset lines. This involves also finding the sign for the orientation of the triangle, since otherwise the inset lines won’t always be inside.
I know that there are simpler ways of scaling a polygon, but here I want the inset to be by a fixed amount, not a proportion of the distance to the center.


