Formula to create a Reuleaux polygon The Wikipedia articles for Reuleaux triangle and curve of constant width do a good job of describing the properties of a Reuleaux polygon, but they don't give a straightforward formula for computing or drawing such a figure, except in terms of the manual compass-and-straightedge construction.
Is there a formula or algorithm that, given the number of sides and the width/diameter, would give some data representation of a Reuleaux polygon that could be used to recreate it programmatically?
In particular, I'm looking for the coordinates of the vertices (or the angle/direction from one vertex to another) and the details of the arc connecting them.
 A: I derived a parametric formula for Reuleaux polygons some time ago in this blog entry.
To make this post self-contained, here are the equations:
$$\begin{align*}
x&=2\cos\frac{\pi}{2n}\cos\left(\frac12\left(t+\frac{\pi}{n}\left(2\left\lfloor\frac{n t}{2\pi}\right\rfloor+1\right)\right)\right)-\cos\left(\frac{\pi}{n}\left(2\left\lfloor\frac{n t}{2\pi}\right\rfloor+1\right)\right)\\
y&=2\cos\frac{\pi}{2n}\sin\left(\frac12\left(t+\frac{\pi}{n}\left(2\left\lfloor\frac{n t}{2\pi}\right\rfloor+1\right)\right)\right)-\sin\left(\frac{\pi}{n}\left(2\left\lfloor\frac{n t}{2\pi}\right\rfloor+1\right)\right)
\end{align*}$$
Here is a Mathematica demonstration:
Table[ParametricPlot[2 Cos[π/(2 n)] Exp[I (t + π (2 Floor[n t/(2 π)] + 1)/n)/2] -
                     Exp[I π (2 Floor[n t/(2 π)] + 1)/n] // ReIm, {t, 0, 2 π}],
      {n, 3, 7, 2}] // GraphicsRow


(Note the use of the complex form of the parametric equations.)

For some applications, a polar equation (like the one in this answer) might be more convenient. One can use the usual distance formula in polar coordinates to derive the polar equation of an $n$-sided Reuleaux polygon:
$$r=\cos\left(\theta -\frac{2\pi}{n}\left\lfloor\frac{n (\theta -\pi )}{2 \pi }+\frac{1}{2}\right\rfloor\right)+\sqrt{1+2\cos\frac{\pi}{n}+\cos^2\left(\theta -\frac{2\pi}{n}\left\lfloor\frac{n (\theta -\pi)}{2 \pi}+\frac{1}{2}\right\rfloor\right)}$$
In Mathematica, one can do this:
Table[PolarPlot[With[{c = Cos[θ - 2 π Floor[n (θ - π)/(2 π) + 1/2]/n]}, 
                     c + Sqrt[1 + 2 Cos[π/n] + c^2]], {θ, 0, 2 π}],
      {n, 3, 7, 2}] // GraphicsRow

to get a picture identical to the one above.
A: As you can see from the diagram below, if $L$ is the length of a side of the regular polygon, $n$ (odd) the number of its sides and $W$ its width, then:
$$L=2W\sin{\pi\over 2n}.$$

A: About four years ago I developed a program to generate Reuleaux logs that were based on random stars of an odd number of points. The algorithm starts at the origin in the complex plane and draws a line of unit length. The it goes to end of that line and draws another off at some random angle, say $\alpha_1$ (within limits, depending on the number of points in the star). You continue in that way up to the penultimate angle, with must be chosen such that the last line returns to the origin. This will require an iteration. Now that the star is complete, you go to each vertex and draw a circular arc to the two opposite points. And voila, you have Reuleaux log.
The program can also compute the perimeter, area, and centroid of the log cross-section. In addition, it can animate the rotation of the log in a square.
I appreciate that this is not as simple as I have made it sound. But I have a working Matlab code, which is not a glowing example of computer science, but I will gladly share it if we can find a vehicle to distribute it here.
