#This is the code for my toy b-robot Artie to "dance"/draw an infinity loop under the table
#include <iostream>
#include <artie>
Artie artie;
void draw_arc(char *direction, float fraction, float radius) {
float L = 78;
float PI = 3.141592;
float distance = PI * 2.0 * radius * fraction;
float angle = atan(L/radius) * 180/PI;
if (direction == 'left'){
angle = -angle;
}
artie.movearc(distance, angle); }
int main() {
artie.pendown(1);
artie.left(90);
draw_arc('right', (1.0/2.0), 50.0);
artie.right(1);
artie.pendown(2);
draw_arc('right', (73.0/360.0), 69.0);
artie.right(1);
draw_arc('left', (73.0/360.0), 69.0);
artie.left(1);
artie.pendown(3);
draw_arc('left', (1.0/2.0), 50.0);
artie.left(1);
artie.pendown(2)
draw_arc('left', (73.0/360.0), 69.0);
artie.left(1);
draw_arc('right', (73.0/360.0), 69.0);
return 0; }