# Rotating Lines Around A circle

**URL:** <https://discourse.processing.org/t/rotating-lines-around-a-circle/1791>\
**Category:** Beginners\
**Created:** [July 15, 2018, 3:20pm UTC](https://discourse.processing.org/t/rotating-lines-around-a-circle/1791 "2018-07-15T15:20:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AnthonyMG](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@AnthonyMG](https://discourse.processing.org/u/AnthonyMG)\
**Post date:** [July 15, 2018, 3:20pm UTC](https://discourse.processing.org/t/rotating-lines-around-a-circle/1791/1 "2018-07-15T15:20:16Z")

</div>

Hello,  
I am trying to rotate 15 lines around the center point of a circle in unison. The lines start at the correct positions, but they rotate at different speeds. Thanks for any help!

```auto
// GLOBAL VARIABLES
final int SUN_DIAMETER = 150;
final int NUMBER_OF_RAYS = 15;
float angle = TWO_PI/NUMBER_OF_RAYS;
float RING_OF_LINES = SUN_DIAMETER*.5 + 30;

// SETUP

void setup(){
   size(600,400);
}

//DRAW

void draw(){
  background(51);
  translate(width/2,height/2);
  
  noFill();
  stroke(255);
  ellipse(0,0,SUN_DIAMETER,SUN_DIAMETER);
  
  
  for(int i = 0; i < NUMBER_OF_RAYS; i++){
    line(RING_OF_LINES,0,RING_OF_LINES+40,0);
    rotate(angle);
  }
  angle += .001;
}

```

---

<div class="post-metadata">

**Author:** ![kfrajer](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kfrajer/32/196_2.png) [@kfrajer](https://discourse.processing.org/u/kfrajer)\
**Post date:** [July 15, 2018, 4:58pm UTC](https://discourse.processing.org/t/rotating-lines-around-a-circle/1791/2 "2018-07-15T16:58:26Z")

</div>

Check the changes.

Kf

```java
// GLOBAL VARIABLES
final int SUN_DIAMETER = 150;
final int NUMBER_OF_RAYS = 15;
float angle = TWO_PI/NUMBER_OF_RAYS;
float RING_OF_LINES = SUN_DIAMETER*.5 + 30;

// SETUP

void setup() {
  size(600, 400);
}

//DRAW

void draw() {
  background(51);
  translate(width/2, height/2);

  noFill();
  stroke(255);
  ellipse(0, 0, SUN_DIAMETER, SUN_DIAMETER);

  for (int i = 0; i < NUMBER_OF_RAYS; i++) {
    pushMatrix();
    rotate(angle +i*TWO_PI/NUMBER_OF_RAYS );
    line(RING_OF_LINES, 0, RING_OF_LINES+40, 0);
    popMatrix();
  }
  angle += .001;
}

```
