Hello

I’m hoping for some help - I’d also really appreciate any guidance as to if this is the best way of thinking.

In my example, I have a line in the shape of a sine wave (although I’d like to apply this thinking to any points following a ‘flat’ path).

I am trying to turn this ‘linear path’ so that the same pattern follows a circular path.

I’ve tried calculating the distance from a set y-axis to the y-axis that my sine wave follows and using this distance as the radius for the curve but I have three issues:

- I’m not sure if this is the best way of thinking.
- My ‘curve’ doesn’t join
- My lines in the curve don’t join either (I’m not sure what I’ve done wrong by creating the x2,y2 points for my curve.

Any help / pointers would be greatly appreciated.

Thanks in advance

Becky

```
void setup() {
size(400,500);
background(0);
stroke(255);
for (int i = 0; i <360; i++) { //i for each degree around the circle
//calculations for initial line where line would be line(x1,y1,x2,y2)
float angleLineStart = map(i,0,359,0,12);
float angleLineEnd = map(i+1,1,360,0,12);
float x1 = i;
float y1 = sin((angleLineStart))*60;
float x2 = (i+1);
float y2 = sin((angleLineEnd))*60;
//calculations for circle
float circleAngleStart = radians(i);
float circleAngleEnd = radians(i+1);
//radius is based on the distance from -100 on the y axis and i on the x axis to translate to the new circle
float radiusStart = dist(x1,-100,x1,y1);
float radiusEnd = dist(x2,-100,x2,y2);
float xCurve = 200 + (cos(circleAngleStart)*radiusStart);
float yCurve = 200 + (sin(circleAngleStart)*radiusStart);
float xCurve2 = 200 + (cos(circleAngleEnd)*radiusEnd);
float yCurve2 = 200 + (sin(circleAngleEnd)*radiusEnd);
line(xCurve,yCurve,xCurve2,yCurve2);
}
}
```