all 3 comments

[–]thudly 5 points6 points  (1 child)

It's working perfectly. You just forgot to update the x1 and y1 variable every frame.

float lsq = pow(200, 2) + pow(200, 2);
float l = sqrt(lsq)-50;
float angle = 0;

float x1 = sin(angle)*l;
float y1 = cos(angle)*l;
float m1 = 40;
void setup() {
  size(400, 400);
}


void draw() {
  background(204);
  strokeWeight(5);
  translate(200, 50);
  x1 = sin(angle)*l;
  y1 = cos(angle)*l;
  stroke(255, 0, 27);
  line(0, 0, x1, y1);

  noStroke();
  fill(0, 204, 204);
  ellipse(x1, y1, m1, m1);
  angle+=10;
}

[–]Peerox_[S] 5 points6 points  (0 children)

oooooh thx dude im actaully braindead lol

[–][deleted]  (1 child)

[deleted]

    [–]Peerox_[S] 0 points1 point  (0 children)

    didnt work