We are about to switch to a new forum software. Until then we have removed the registration on this forum.

- All Categories 25.7K
- Announcements & Guidelines 13
- Common Questions 30
- Using Processing 22.1K
- Programming Questions 12.2K
- Questions about Code 6.4K
- How To... 4.2K
- Hello Processing 72
- GLSL / Shaders 292
- Library Questions 4K
- Hardware, Integration & Other Languages 2.7K
- Kinect 668
- Arduino 1K
- Raspberry PI 188
- Questions about Modes 2K
- Android Mode 1.3K
- JavaScript Mode 413
- Python Mode 205
- Questions about Tools 100
- Espanol 5
- Developing Processing 548
- Create & Announce Libraries 211
- Create & Announce Modes 19
- Create & Announce Tools 29
- Summer of Code 2018 93
- Rails Girls Summer of Code 2017 3
- Summer of Code 2017 49
- Summer of Code 2016 4
- Summer of Code 2015 40
- Summer of Code 2014 22
- p5.js 1.6K
- p5.js Programming Questions 947
- p5.js Library Questions 315
- p5.js Development Questions 31
- General 1.4K
- Events & Opportunities 289
- General Discussion 365

Hello,

I have the following loop:

```
for (TableRow row : table.rows()) {
x = row.getInt("Height");
ellipse(0,0,x,x);
};
```

In this loop x is taken from a spreadsheet showing the height of 50 buildings sorted from highest to smallest.

At the moment the size of the circle is determined by the size of each building so the higher the building, the bigger the circle.

The output image is 50 concentric circles. I am trying to change the sketch so that the biggest building = the smallest circle (like contour lines). Because there is no pattern in the building heights the circles are not evenly spaced and I cant work out how to keep swap the circles around (small-hight / large=low) and keep the circles spaced correctly.

I hope this makes sense, thanks!

Tagged:

## Answers

Have you tried something like:

`table.sortReverse("Height");`

? :-??he just wants to map higher buildings to smaller radius.

i think you can use

`map(radius, min_height, max_height, max_radius, min_radius);`

but it might not work given the data (which i've not seen)Yes, thats correct. The bigger the building, the smaller the radius of the circle representing it. The data is simply a spreadsheet with two columns - First column is a list of building names and beside that is a column with the heights in metres.

I have worked out a solution (might not be the best solution but it seems to work)

x = (-height)+200; ellipse(0,0,x,x);

Thanks