Hi there,

I’m trying to get this circular motion to bound off the border of my container (wrap I think) how would I go about that?

Thanks,

Lena

```
float x;
float y;
float x1;
float y1;
float x2;
float y2;
//float = decimal number
float angle;
float axis_x;
float axis_y;
float radius;
float speed_x;
float direction_x;
float speed_y;
float direction_y;
void setup(){
size(600,600);
background(255);
axis_x = 10;
axis_y = 10;
angle = 0.01;
x = 0;
y = 0;
x1 = 0;
y1 = 0;
x2 = 0;
y2 = 0;
frameRate(120);
}
void update(){
angle = angle + .1;
//add slope (linear motion) = compound motion
x2 = x2 + 1;
y2 = y2 * 1;
}
void draw(){
//background (255);
update();
radius = (x1 + 1);
radius = (x2 + 1);
radius = (y1 + 1);
radius = (y2 + 1);
//calculation of angles
x1 = 1 + cos(angle * .01) * 1.5 * TWO_PI;
y1 = 300 + sin(angle * 20) * 1.5 * TWO_PI;
//calculate x
x = x1 + x2;
y = y1 + y2;
//render
fill(255,0,0);
noStroke();
ellipse(x,y,5,5);
}
void keyPressed (){
if(key == 'x') saveFrame("check_in_05_Lena_####.png");
}
```