Recently I got myself into some analytic geometry, more precisely, I learned about the equation $|x|+|y|=a$ which gives the equation for a $a\sqrt 2$ sided square, so I was wondering what equations could describe any regular polygons, and secondly, is there a way to get the equation for a polygon which has $N$ known points as its corners.
What I managed to find out is that for $N$ even number of sides, the equations get quite simple, you just write the equations for the diagonals, with a normalising factor. For example, for the hexagon, the equation looks something like this: $\left|y-\sqrt{3}x\right|+\left|y+\sqrt{3}x\right|+\left|\sqrt{3}y\right|=a$.
The problem rises when I try to do the same for a $N$ odd number of sides. The absolute value functions imply some kind of symmetry, which I figured I needed to break by adding a $y+ax+b$ term on its own (I might be wrong on this conclusion). I got some equation for a pentagon (view graph here https://www.desmos.com/calculator/4lwudrkjpi) which only works in a certain range for the given parameters. I also tried to figure the equations for each of the sides, and set the angle between each two of them equal to $2\pi/5$, but the results I got didn't do anything.
For the triangle equation I got something like this $\left|2y\right|+\left|y+2x+m-a\right|+\left|y-2x-m\right|=a$ where $a$ and $m$ are any real numbers, but it cannot be rendered because when $y+2x+m-a<0$ and $y-2x-m <0$ I get $0=0$.
If you have any knowledge on this that you would like to share, I will gladly appreciate it!
I know a similar question has been asked and the answer was $r=\frac{cos \pi/n}{cos (\theta -\frac{2\pi}n floor (\frac{n\theta + 2\pi}{2\pi}))}$, I was just curious if a similar results could be achieved using the absolute value function solely.