I need help creating a hypotrochoid. Starting with three values (inner radius, outer radius, and distance), I need to draw a shape by computing a sequence of points, drawing straight lines from point, to point, to point, etc.
I started a little but I'm now completely lost and don't really know what I'm doing. Anything will help thank you.
Hypotrochoid: https://en.wikipedia.org/wiki/Hypotrochoid
float xpos,ypos,r,d,R,t,a,b;
int centerX,centerY,center;
void setup() {
size(600,600);
centerX = width/2;
centerY = height/2;
ellipse(300, 300, 300, 300);
t = 25;
a = 10;
b = 5;
}
void draw(){
xpos=(a-b)*cos(t)+h*cos(((a-b)/b)*t);
ypos=(a-b)*sin(t)+h*sin(((a-b)/b)*t);
}
