0

I'm trying to get a reuleaux triangle, the interior triangle, the radius, and its midpoint. I don't know how to get all of that into the same diagram

  • 1
    Questions seeking debugging help (“why isn't this code working?”) must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See minimal working example (MWE). – Henri Menke Nov 22 '19 at 00:41
  • See https://tex.stackexchange.com/questions/160539/drawing-a-reuleaux-triangle – Scott H. Nov 22 '19 at 00:50
  • 2
    I have removed the [geometry] tag, as that applies explicitly to the geometry package. Replaced it with [shapes]. – barbara beeton Nov 22 '19 at 03:04

1 Answers1

4

This is a modest generalization of Mark Wibrow's answer, hoping that I interpreted the Wikipedia article correctly. The number of corners is odd, n=2N+1. You can specify N, the radius and the style of edges vs. arcs, and since these are pics, you can apply the usual transformations like rotations.

\documentclass[tikz,border=3mm]{standalone}
% based on https://tex.stackexchange.com/a/160705/194703
\tikzset{pics/Reuleaux polygon/.style={code={
\tikzset{Reuleaux/.cd,#1}
\def\pv##1{\pgfkeysvalueof{/tikz/Reuleaux/##1}}
\pgfmathtruncatemacro{\myorder}{2*\pv{N}+1}
\path[pic actions,Reuleaux/edges] ({90}:\pv{r})
foreach \XX in {1,...,\the\numexpr\myorder-1} 
 {-- ({90+\XX*360/\myorder}:\pv{r})}
 -- cycle;
\path[pic actions,Reuleaux/arcs]({90}:\pv{r})
  foreach \XX in {0,...,\the\numexpr\myorder-1} 
  {[rotate={(\XX+0.25)*360/\myorder}]  
  arc(90:90+180/\myorder:{\pv{r}*cos(90/\myorder)*2})
  };
}},Reuleaux/.cd,N/.initial=3,r/.initial=1cm,%<- radius
    edges/.style={draw=black},%<- appearance of edges
    arcs/.style={draw=blue}%<- appearance of arcs
}
\begin{document}
\begin{tikzpicture}
 \path foreach \X in {1,...,4}
 {(\X*3,0) pic{Reuleaux polygon={N=\X}}};
\end{tikzpicture}
\end{document}

enter image description here