# Increasing Ellipses loop (Mandala)

**URL:** <https://discourse.processing.org/t/increasing-ellipses-loop-mandala/43640>\
**Category:** Coding Questions\
**Created:** [January 7, 2024, 9:24pm UTC](https://discourse.processing.org/t/increasing-ellipses-loop-mandala/43640 "2024-01-07T21:24:17Z")\
**Posts on this page:** 9\
**Page:** 2

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [January 9, 2024, 8:51pm UTC](https://discourse.processing.org/t/increasing-ellipses-loop-mandala/43640/21 "2024-01-09T20:51:29Z")

</div>

do you want to avoid that the ellipses overlap?? Yes or no?

---

<div class="post-metadata">

**Author:** ![humano](https://avatars.discourse-cdn.com/v4/letter/h/dbc845/32.png) [@humano](https://discourse.processing.org/u/humano)\
**Post date:** [January 9, 2024, 8:53pm UTC](https://discourse.processing.org/t/increasing-ellipses-loop-mandala/43640/22 "2024-01-09T20:53:33Z")

</div>

Yes i do, I want a fluent growing but with a really full center and a really light outer part, more or less as here

 ![IMG_20240109_150742](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/c/8/c84a885f54db1a8144612583ce7ca68d434a080d.jpeg)  
With just one loop, if center is full, external part is not as light as I wanted, and if external part is light, center is not as full as I wanted, that is why I have drawn more loops, but then you see those unwanted cuts between them. So which type of function can grow like this?

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [January 9, 2024, 9:16pm UTC](https://discourse.processing.org/t/increasing-ellipses-loop-mandala/43640/23 "2024-01-09T21:16:59Z")

</div>

> [@humano](#):
>
> with a really full center and a really light outer part

I did this above with sin.

Did you try?

---

<div class="post-metadata">

**Author:** ![humano](https://avatars.discourse-cdn.com/v4/letter/h/dbc845/32.png) [@humano](https://discourse.processing.org/u/humano)\
**Post date:** [January 9, 2024, 9:21pm UTC](https://discourse.processing.org/t/increasing-ellipses-loop-mandala/43640/24 "2024-01-09T21:21:48Z")

</div>

Do you mean this?

 ![Screenshot_2024-01-09-17-20-29-257_com.calsignlabs.apde.sketchpreview-edit](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/c/7/c73c09e34246359bcf42eb039320fa38e832f2d5.jpeg)  
i was thinking more about this, but clean  
 ![Screenshot_2024-01-09-17-18-52-434_com.calsignlabs.apde.sketchpreview-edit](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/b/5/b5bd809ae5d9cb893b3ac52fb91922ad3f8824f6.jpeg)

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [January 9, 2024, 9:24pm UTC](https://discourse.processing.org/t/increasing-ellipses-loop-mandala/43640/25 "2024-01-09T21:24:06Z")

</div>

more random?

```auto

size (2000, 1000);

float a=2.11;

ellipseMode(CENTER);
noFill();
strokeWeight(1);

int i=0;

for (int j=1; j<1500; j+=random(a, a+a*4) ) {
  ellipse(500, 500, j, j);
  a = sin(radians(i))*14;
  i+=1.0;
  point(i, a);
  println(a);
}
println("done");

```

---

<div class="post-metadata">

**Author:** ![humano](https://avatars.discourse-cdn.com/v4/letter/h/dbc845/32.png) [@humano](https://discourse.processing.org/u/humano)\
**Post date:** [January 9, 2024, 9:27pm UTC](https://discourse.processing.org/t/increasing-ellipses-loop-mandala/43640/26 "2024-01-09T21:27:36Z")

</div>

Not random, with a slow growing at the beginning and a fast one at the end, as you can see on the picture , but somethig continous

 ![Screenshot_2024-01-09-17-18-52-434_com.calsignlabs.apde.sketchpreview-edit](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/3X/b/5/b5bd809ae5d9cb893b3ac52fb91922ad3f8824f6.jpeg)  
They could be three parts, the center, the middle and the outer part, but at least I need to avoid cuts between them, maybe lnowing values of every part

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [January 9, 2024, 10:26pm UTC](https://discourse.processing.org/t/increasing-ellipses-loop-mandala/43640/27 "2024-01-09T22:26:59Z")

</div>

here you can press a key to go from  
color to b/w

and space to restart

```auto

int i =0;
int i2 = 0;

// extension
PVector xM=new PVector(22, 22),
  yM=new PVector(22, 22);

ArrayList<Ell> list = new ArrayList();

boolean first=true;

// ----------------------------------------------------------------------------------------------

void setup() {
  size (1900, 999);
  // frameRate(1);
  fill();
}

void draw() {
  background(111);
  ellipseMode(CENTER);

  if (!keyPressed) {
    for (int k=list.size()-1; k>=0; k-- ) {
      // fill();
      Ell el=list.get(k);
      el.display();
      // noLoop();
    }
  } else {
    noFill();
    for (Ell el : list) {
      el.display();
    }
  }
}

// --------------------------------------------------------------------------

void keyPressed() {
  if (key==' ') {
    i =0;
    i2 = 0;
    list.clear();
    first=true;
    xM=new PVector(22, 22);
    yM=new PVector(22, 22);
    fill();
  }
}

void fill() {
  //for (int i=0; i<400; i=i+5) {
  ellipseAdd(random(width/2-10, width/2+10), random(240, 260),
    i+random(25), i+random(25),
    color(random(255), random(255), random(255)));
  i=i+5;
  // }
  i2++;

  if (i2 < 100)
    fill();
}

// --------------------------------------------------------------------------

void ellipseAdd(float x_, float y_,
  float radX_, float radY_,
  color col_) {
  //
  list.add(new Ell( x_, y_,
    radX_, radY_,
    col_));

  if (first) {
    first=false;
    xM.x= x_-radX_/2-1;
    xM.y= x_+radX_/2+1;

    yM.x= y_-radY_/2-1;
    yM.y= y_+radY_/2+1;
    list.remove(0);
  }
}

// ===========================================================================

class Ell {

  float x, y, radX, radY;

  color col;

  Ell(float x_, float y_,
    float radX_, float radY_,
    color col_) {
    //
    x=x_;
    y=y_;

    radX=radX_;
    radY=radY_;

    col=col_;

    if (x-radX/2-1>=xM.x) {
      while (x-radX/2-1>=xM.x)
        radX+=1;
    }
    if (x+radX/2+1 <= xM.y) {
      while (x+radX/2+1<=xM.y)
        radX+=1;
    }

    // ----

    if (y-radY/2-1>=yM.x) {
      while (y-radY/2-1>=yM.x)
        radY+=1;
    }
    if (y+radY/2+1 <= yM.y) {
      while (y+radY/2+1<=yM.y)
        radY+=1;
    }
    //if (radY<yM) {
    // radY=yM+1;
    //}

    xM.x= x-radX/2-1;
    xM.y= x+radX/2+1;

    yM.x= y-radY/2-1;
    yM.y= y+radY/2+1;
  }

  void display() {
    fill(col);
    if (keyPressed)
      noFill();

    ellipse(x, y, radX, radY);
  }
}

```

---

<div class="post-metadata">

**Author:** ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)\
**Post date:** [January 9, 2024, 10:27pm UTC](https://discourse.processing.org/t/increasing-ellipses-loop-mandala/43640/28 "2024-01-09T22:27:56Z")

</div>

> [@humano](#):
>
> a slow growing at the beginning and a fast one at the end, as you can see on the picture , but somethig continous

that’s exactly what my sin-Sketch does

---

<div class="post-metadata">

**Author:** ![humano](https://avatars.discourse-cdn.com/v4/letter/h/dbc845/32.png) [@humano](https://discourse.processing.org/u/humano)\
**Post date:** [January 9, 2024, 11:20pm UTC](https://discourse.processing.org/t/increasing-ellipses-loop-mandala/43640/29 "2024-01-09T23:20:43Z")

</div>

Well, your sketch is amazing! absolutely beatiful! Thank you so much for your help.  
But actuallly I was thinking about something as this:

```auto
size (1000, 1000);
background(255,255,255);
ellipseMode(CENTER);
noFill();
strokeWeight(1);

for (int j=0,a=0; j<200; j+=1+a) {
  //stroke(255,0,0);
  ellipse(500,500, j, j);
  a=a+1;
  //println(a);
}

for (int k=210, b=20; k<400; k+=2+b){
  //stroke(0,0,255);
  ellipse(500,500, k,k);
  b=b+2;
  println(b);
} 

for (int l=424, c=36; l<600; l+=3+c){
//stroke(0,122,0);
ellipse(500,500, l,l);
c=c+3;
}

println("done");

```

[Previous page](https://discourse.processing.org/t/increasing-ellipses-loop-mandala/43640.md?page=1)
