# Making multiple images rotate in a circle

**URL:** https://discourse.processing.org/t/making-multiple-images-rotate-in-a-circle/17795
**Category:** Coding Questions
**Created:** [February 13, 2020, 4:21pm UTC](https://discourse.processing.org/t/making-multiple-images-rotate-in-a-circle/17795 "2020-02-13T16:21:29Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Alexsmithson](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@Alexsmithson](https://discourse.processing.org/u/Alexsmithson)
#### Post date: [February 13, 2020, 4:21pm UTC](https://discourse.processing.org/t/making-multiple-images-rotate-in-a-circle/17795/1 "2020-02-13T16:21:29Z")

</div>

I NEED HELP FROM THE PROCESSING GODS!

i need to make multiple images rotate in a circular shape so it fits with the lines of text. so far i have these lines of code, and i need to make the images rotate in the same fashion:

String[] names = { “Nicolai Wammen, S”,“Jakob Ellemann-Jensen, V”,“Alex Vanopslagh, LA”,“Pernille Skipper, EL”,“Pia Olsen Dyhr, SF”,“Søren Pape, KF”,“Mai Mercado, KF”,  
“Jacob Mark, SF”,“Sophie Løhde, V”,“Martin Lidegaard, RV”,“Mattias Tesfaye, S”,“Morten Østergaard, RV”,“Rune Lund, EL”,“Josefine Fock, ALT”,“Peter Skaarup, DF”,“Uffe Elbæk, ALT”,  
“Pernille Vermund, NB”,“Karina Adsbøl, DF”};

float delta = TWO\_PI / names.length;  
int radius = names.length \*4;

void setup() {  
size(500,500);  
}

void draw() {  
background(0);  
fill(255);

for(int i = 0; i\<names.length; i++) {

float xPos = width/2+radius \* cos(i\* delta);  
float yPos = height/2+radius \* sin(i\* delta);

pushMatrix();  
translate(xPos, yPos);  
rotate(delta \* i);  
text(names[i], 0, 0);  
popMatrix();  
}

i have no idea how to make this work, i feel that i have tried everything but i just keep getting errors. so please if there is someone out there who is an processing beast and wants to help a struggling brother out, please do. thank you in advance to any comment.

---

<div class="post-metadata">

### Author: ![Alexsmithson](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@Alexsmithson](https://discourse.processing.org/u/Alexsmithson)
#### Post date: [February 13, 2020, 4:23pm UTC](https://discourse.processing.org/t/making-multiple-images-rotate-in-a-circle/17795/2 "2020-02-13T16:23:36Z")

</div>

the picture files are:

“ttps://pbs.twimg.com/profile\_images/784033734492295171/0bjAltXy\_400x400\_normal.jpg”,  
“ttps://pbs.twimg.com/profile\_images/998483212337729536/ttKM1rva\_400x400\_normal.jpg”,  
“ttps://pbs.twimg.com/profile\_images/796705836177428480/sydPXxza\_400x400\_normal.jpg”,  
“ttps://pbs.twimg.com/profile\_images/448386911485571072/hExlryDp\_400x400\_normal.jpeg”,  
“ttps://pbs.twimg.com/profile\_images/854404645615267841/b\_My2Osh\_400x400\_normal.jpg”,  
“ttps://pbs.twimg.com/profile\_images/684285213002854400/rsLOYDnL\_400x400\_normal.jpg”,  
“ttps://pbs.twimg.com/profile\_images/666937735811346433/bNwwscqA\_400x400\_normal.jpg”,  
“ttps://pbs.twimg.com/profile\_images/1094388795439501314/D\_TbQ70q\_400x400\_normal.jpg”,  
“ttps://pbs.twimg.com/profile\_images/1032541875012612096/69Mm0RUu\_400x400\_normal.jpg”,  
“ttps://pbs.twimg.com/profile\_images/615142808480051200/p49qK4BR\_400x400\_normal.jpg”,  
“ttps://pbs.twimg.com/profile\_images/510685434343862273/nN7iTNf2\_400x400\_normal.jpeg”,  
“ttps://pbs.twimg.com/profile\_images/1116626248988381184/SIXwL\_bg\_400x400\_normal.png”,  
“ttps://pbs.twimg.com/profile\_images/672354743289712640/VzOhnPiC\_400x400\_normal.jpg”,  
“ttps://pbs.twimg.com/profile\_images/876452994463801345/d3mYj8jJ\_400x400\_normal.jpg”,  
“ttps://pbs.twimg.com/profile\_images/1198941852650627072/jy-YgI28\_400x400\_normal.jpg”,  
“ttps://pbs.twimg.com/profile\_images/1164932031786180611/BTLwV64k\_400x400\_normal.jpg”,  
“ttps://pbs.twimg.com/profile\_images/1029267040132128768/jPBvj279\_400x400\_normal.jpg”,  
“ttps://pbs.twimg.com/profile\_images/1171488902856622080/3j\_6Gc32\_400x400\_normal.jpg”;

\*\*\* they are all https:// but apperently i am not allowed to write that

\<3 \<3

---

<div class="post-metadata">

### Author: ![AndreasRef](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/andreasref/32/133_2.png) [@AndreasRef](https://discourse.processing.org/u/AndreasRef)
#### Post date: [February 13, 2020, 4:33pm UTC](https://discourse.processing.org/t/making-multiple-images-rotate-in-a-circle/17795/3 "2020-02-13T16:33:07Z")

</div>

Something along the lines of this?

 ![Screenshot 2020-02-13 at 17.31.45](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/4/4f20cfa5d7a946e7522a5a113a0989cc370ef054.jpeg)

```auto
String[] names = { "Nicolai Wammen, S", "Jakob Ellemann-Jensen, V", "Alex Vanopslagh, LA", "Pernille Skipper, EL", "Pia Olsen Dyhr, SF", "Søren Pape, KF", "Mai Mercado, KF", 
  "Jacob Mark, SF", "Sophie Løhde, V", "Martin Lidegaard, RV", "Mattias Tesfaye, S", "Morten Østergaard, RV", "Rune Lund, EL", "Josefine Fock, ALT", "Peter Skaarup, DF", "Uffe Elbæk, ALT", 
  "Pernille Vermund, NB", "Karina Adsbøl, DF"};

String[] urls = {
  "https://pbs.twimg.com/profile_images/784033734492295171/0bjAltXy_400x400_normal.jpg", 
  "https://pbs.twimg.com/profile_images/998483212337729536/ttKM1rva_400x400_normal.jpg", 
  "https://pbs.twimg.com/profile_images/796705836177428480/sydPXxza_400x400_normal.jpg", 
  "https://pbs.twimg.com/profile_images/448386911485571072/hExlryDp_400x400_normal.jpeg", 
  "https://pbs.twimg.com/profile_images/854404645615267841/b_My2Osh_400x400_normal.jpg", 
  "https://pbs.twimg.com/profile_images/684285213002854400/rsLOYDnL_400x400_normal.jpg", 
  "https://pbs.twimg.com/profile_images/666937735811346433/bNwwscqA_400x400_normal.jpg", 
  "https://pbs.twimg.com/profile_images/1094388795439501314/D_TbQ70q_400x400_normal.jpg", 
  "https://pbs.twimg.com/profile_images/1032541875012612096/69Mm0RUu_400x400_normal.jpg", 
  "https://pbs.twimg.com/profile_images/615142808480051200/p49qK4BR_400x400_normal.jpg", 
  "https://pbs.twimg.com/profile_images/510685434343862273/nN7iTNf2_400x400_normal.jpeg", 
  "https://pbs.twimg.com/profile_images/1116626248988381184/SIXwL_bg_400x400_normal.png", 
  "https://pbs.twimg.com/profile_images/672354743289712640/VzOhnPiC_400x400_normal.jpg", 
  "https://pbs.twimg.com/profile_images/876452994463801345/d3mYj8jJ_400x400_normal.jpg", 
  "https://pbs.twimg.com/profile_images/1198941852650627072/jy-YgI28_400x400_normal.jpg", 
  "https://pbs.twimg.com/profile_images/1164932031786180611/BTLwV64k_400x400_normal.jpg", 
  "https://pbs.twimg.com/profile_images/1029267040132128768/jPBvj279_400x400_normal.jpg", 
  "https://pbs.twimg.com/profile_images/1171488902856622080/3j_6Gc32_400x400_normal.jpg"
};

PImage [] images = new PImage [urls.length];
float delta = TWO_PI / names.length;
int radius = names.length *4;

void setup() {
  size(500, 500);

  for (int i = 0; i<urls.length; i++) {
    images[i] = loadImage(urls[i]);
  }
  imageMode(CENTER);
}

void draw() {
  background(0);
  fill(255);

  for (int i = 0; i<names.length; i++) {

    float xPos = width/2+radius * cos(i* delta);
    float yPos = height/2+radius * sin(i* delta);

    pushMatrix();
    translate(xPos, yPos);
    rotate(delta * i);
    text(names[i], 0, 0);
    image(images[i], 150, 0);
    popMatrix();
  }
}

```

---

<div class="post-metadata">

### Author: ![Alexsmithson](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@Alexsmithson](https://discourse.processing.org/u/Alexsmithson)
#### Post date: [February 13, 2020, 4:50pm UTC](https://discourse.processing.org/t/making-multiple-images-rotate-in-a-circle/17795/4 "2020-02-13T16:50:40Z")

</div>

AndresRef you are my new bestfriend! that is exactly what I was trying to do!!

you deserve the best and most positive karma in your future!

---

<div class="post-metadata">

### Author: ![AndreasRef](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/andreasref/32/133_2.png) [@AndreasRef](https://discourse.processing.org/u/AndreasRef)
#### Post date: [February 13, 2020, 10:54pm UTC](https://discourse.processing.org/t/making-multiple-images-rotate-in-a-circle/17795/5 "2020-02-13T22:54:46Z")

</div>

No problem, glad I could help.

Btw, I assume you are from Denmark 🇩🇰? Me too 😛

---

<div class="post-metadata">

### Author: ![Alexsmithson](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@Alexsmithson](https://discourse.processing.org/u/Alexsmithson)
#### Post date: [April 22, 2020, 3:04pm UTC](https://discourse.processing.org/t/making-multiple-images-rotate-in-a-circle/17795/6 "2020-04-22T15:04:47Z")

</div>

thank you so much for your help last time. You dont happen to be a genius with SQLite also do you? 🙂

---

<div class="post-metadata">

### Author: ![AndreasRef](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/andreasref/32/133_2.png) [@AndreasRef](https://discourse.processing.org/u/AndreasRef)
#### Post date: [July 8, 2020, 2:13pm UTC](https://discourse.processing.org/t/making-multiple-images-rotate-in-a-circle/17795/7 "2020-07-08T14:13:52Z")

</div>

Hi Alex. Sorry, I guess I saw this post way to late. No, I forgot everything I ever learned about SQL a long time ago 🙃
