I am attempting to design a function that will draw a reuleaux triangle.
My approach is to translate to the centre of the Processing window and then use the Beziervertex functions to draw each arc, but before each conscutive arc, implement a rotation translation, such that the same code for the first arc is simply repeated for the 2 other arcs.
This strangely failed as I had to manually vary the controls for the curves in the Bezier functions, seemingly due to the translation not working as I expected.
Any help would be appreciated (code below)....... (see lines 47, 50, 53)
int w = 400; //window width
int h = 200; //window height
int l = h/2; //equilateral triangle side size
float p = 24;
float r = ( (l/2) / (cos(PI/6) ) );
float p = r * sin(PI/6);
float x = p / tan(PI/6);
// draw background outlines
ellipse(0,0,2*r,2*r);
line(0,0,0,-h/2);
rotate(2*(PI/3));
line(0,0,0,-h/2);
rotate(2*(PI/3));
line(0,0,0,-h/2);
rotate(2*(PI/3));
strokeWeight(3);
// left lower point
point(x, p);
// right lower point
point(-x, p);
// top point
point(0, -r);