# Is there a function that draws a triangle with rounded edges?

Gabriel Lamé formula allows to convert a circle to a rounded rectangle and finally to a rectangle:

$$x^n + y^n=1$$

Is there a formula from which to connect the triangle to a rounded triangle to a circle?

I found the Reuleaux triangle, but it gets rounder by inflating the sides instead of rounding the edges.

• Isn't that a formula? Maybe you can be more specific about what you are looking for. – Thomas Andrews May 8 '14 at 12:29
• Consider $\;\displaystyle f_n:x\mapsto \left(1-|x|^n\right)^{\frac 1n}\;$ then $f_1$ gives a triangle for $x\in (-1,1)$ while $f_2$ describes a half-circle . This using nearly your initial equation $|x|^n + y^n=1$ as hinted by Thomas Andrews. – Raymond Manzoni May 8 '14 at 13:51

## 2 Answers

We can regard $|x|^n+|y|^n$ as the sum of four "barrier functions" $|x|^n$, $|y|^n$, $\lvert-x|^n$, $\lvert-y|^n$ at $90^\circ$ to each other. (Well, it's true up to a multiplicative factor.) To obtain a triangle, we can try constructing three barrier functions at $120^\circ$.

Define $g(t)=\bigl| t-\frac13\bigr|^n$ and $\theta_i=2\pi\frac i3$, and let \begin{align} f(x,y) &= \sum_{i=1}^3g(x\cos\theta_i+y\sin\theta_i) \\ &= \sum_{i=1}^3\left|x\cos\frac{2\pi i}3+y\sin\frac{2\pi i}3-\frac13\right|^n. \end{align}

Here are plots of $f(x,y)=1$ for different $n$.

The $-\frac13$ is necessary in the definition of $g$ because otherwise you obtain a hexagon.

Let's consider your problem from the point of view of polar coordinates.

An equilateral triangle may be expressed as $$\tag{1}\rho(\theta)=\frac {-1}{2\;\cos\,g(\theta)}$$ with $g$ defined by $\quad g(\theta)=\begin{cases} \theta-\frac{2\pi}3,&-\frac{2\pi}3<\theta<0\\ \theta+\frac{2\pi}3,&0\le\theta<\frac{2\pi}3\\ \theta,&\frac{2\pi}3\le\theta\le\frac{4\pi}3\\ \end{cases}$

getting this picture :

Polar coordinates allow an easy transition to the unit circle (as $n\to\infty$) for example using $$\tag{2}\rho_n(\theta)=\left(\frac {-1}{2\;\cos\,g(\theta)}\right)^{1/n}$$ Result for $n=3$ :

To get a triangle rounded at the corners a little more work on $g(\theta)$ produced :
(note that I replaced $1/n$ in $(2)$ by $1/n^p$ with the parameter $p=2$ here) $$\tag{3}\rho_n(\theta)=\left(\frac {-1}{2\;\cos\,g_n(\theta)}\right)^{1/n^2}$$

with : $\quad g_n(\theta)=\begin{cases} a\left(h_n\left(\frac{\theta}a\right)+\operatorname{sgn}(\theta)\right),&-a<\theta<a\\ a\left(h_n\left(\frac{\theta}a-1\right)+1\right),&a\le\theta\le 2a\\ \end{cases}$

where $a:=\dfrac{2\pi}3\;$ and $\;\displaystyle h_n(x):=\operatorname{sgn}(x)\,\frac{1+\operatorname{sgn}(2\,|x|-1)\,\left[1-(1-\left|2\,|x|-1\right|)^n\right]}2$

($\operatorname{sgn}$ is the "sign function" and $|x|$ the absolute value)

Result for $n=1.7$

Hoping this helped,