# Lissajous tables

**URL:** <https://discourse.processing.org/t/lissajous-tables/26282>\
**Category:** Gallery\
**Created:** [December 15, 2020, 9:19pm UTC](https://discourse.processing.org/t/lissajous-tables/26282 "2020-12-15T21:19:06Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![CodeMasterX](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/codemasterx/32/2942_2.png) [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Post date:** [December 15, 2020, 9:19pm UTC](https://discourse.processing.org/t/lissajous-tables/26282/1 "2020-12-15T21:19:06Z")

</div>

Hi! I created a new project! The Lissajous tables! Difficulty: 1000/10

```auto
int cx = 300, cy = 300,scl=60,a=10,b=10;
void setup() {
  size(600,600);
}
void draw() {
  background(0);
  stroke(255);
  for(int i = 1; i < a+1; i++) {
    for(int j = 1; j < b+1; j++) {
      
      for(int k = 0; k < 1000; k++) {
        float a = TWO_PI/1000;
        float x = scl/2 * cos(a*k*i), y = scl/2 * sin(a*k*j);
        point(x+(i-0.5)*scl,y+(j-0.5)*scl);
      }
    }
  }
}

```

or a shorter version:

```auto
size(600, 600);
for (int i = 1; i < 11; i++) for (int j = 1; j < 11; j++) for (int k = 0; k < 1000; k++) {
  point(30 * cos(TWO_PI/1000*k*i)+(i-0.5)*60, 60/2 * sin(TWO_PI/1000*k*j)+(j-0.5)*60);
}

```

or a bit longer version

```auto
int scl = 60, a = 10, b = 10;
size(600, 600);
background(0);
stroke(255);
for (int i = 1; i < a+1; i++) for (int j = 1; j < b+1; j++) for (int k = 0; k < 1000; k++) {
  point(scl/2 * cos(TWO_PI/1000*k*i)+(i-0.5)*scl, scl/2 * sin(TWO_PI/1000*k*j)+(j-0.5)*scl);
}

```

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/1/1605cb5db9865fadf433940d48e055e2c732b638.png)

---

<div class="post-metadata">

**Author:** ![CodeMasterX](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/codemasterx/32/2942_2.png) [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Post date:** [December 16, 2020, 8:38am UTC](https://discourse.processing.org/t/lissajous-tables/26282/2 "2020-12-16T08:38:37Z")

</div>

If you want to add a buffer (padding around the shapes)

```auto
int a = 10, b = 10, scl = 60, buffer = 10;
size(720,720);
background(0);
stroke(255);
for(int i = 1; i < a + 1; i++) {
  for(int j = 1; j < b + 1; j++) {
    for(int k = 0; k < 1000; k ++) {
      float ang = TWO_PI/1000;
      point( (i-0.5)*scl+i*buffer + scl/2 * cos(ang*k*i), (j-0.5)*scl + j*buffer + scl/2 * sin(ang*k*j));
      
    }
  }
}

```

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/0/0ae71a572bef530768c189d74451b3c278a078eb.png)

---

<div class="post-metadata">

**Author:** ![CodeMasterX](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/codemasterx/32/2942_2.png) [@CodeMasterX](https://discourse.processing.org/u/CodeMasterX)\
**Post date:** [December 16, 2020, 8:40am UTC](https://discourse.processing.org/t/lissajous-tables/26282/3 "2020-12-16T08:40:16Z")

</div>

You can also do this:

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/d/d5d7deb063959754b3e62aeadfeaf683be6c7602.png)

---

<div class="post-metadata">

**Author:** ![colin](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/colin/32/230_2.png) [@colin](https://discourse.processing.org/u/colin)\
**Post date:** [December 16, 2020, 11:59am UTC](https://discourse.processing.org/t/lissajous-tables/26282/4 "2020-12-16T11:59:37Z")

</div>

That one would make a sick album cover 😃  
I’m thinking about some minimalist drone or something 🤔
