# Equally dividing a circular area

**URL:** https://discourse.julialang.org/t/equally-dividing-a-circular-area/58151
**Category:** New to Julia
**Tags:** algorithm
**Created:** [March 29, 2021, 8:18am UTC](https://discourse.julialang.org/t/equally-dividing-a-circular-area/58151 "2021-03-29T08:18:08Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![JuliusAurelius](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@JuliusAurelius](https://discourse.julialang.org/u/JuliusAurelius)
#### Post date: [March 29, 2021, 8:18am UTC](https://discourse.julialang.org/t/equally-dividing-a-circular-area/58151/1 "2021-03-29T08:18:08Z")

</div>

Hi, I am working on a project where I need to divide a unit circle into roughly equal areas.  
Ideally I’d have a function  
`location, area = divideCircleArea(nAreas);`  
where `nAreas` is the number of areas (typically about 50). `location` would be the center of each area [x,y] and `area` the relative area the point represents.

My solution (in Matlab) so far was to use a [sunflower distribution](https://demonstrations.wolfram.com/SunflowerSeedArrangements/) to get the locations and then use the [voronoin function](https://nl.mathworks.com/help/matlab/ref/voronoin.html) to create the areas and get the edges, which I would pass on to [polyarea](https://nl.mathworks.com/help/matlab/ref/polyarea.html) to get the area, which is then normalized.

How would you solve the issue in Julia? Is there another, better approach?

---

<div class="post-metadata">

### Author: ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)
#### Post date: [March 29, 2021, 9:39am UTC](https://discourse.julialang.org/t/equally-dividing-a-circular-area/58151/2 "2021-03-29T09:39:19Z")

</div>

This article by [Masset et al.](https://orbi.uliege.be/bitstream/2268/91953/1/masset_isocell_orbi.pdf), shows a simple algorithm to divide the circle that you might consider.  
The method has a constraint: `nAreas = N1*n^2`, where `N1` is the number of divisions of the inner ring and `n` is the total number of rings. So, for `nAreas = 50`, you may consider `N1=2` and `n=5`.

---

<div class="post-metadata">

### Author: ![klaff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/klaff/32/7637_2.png) [@klaff](https://discourse.julialang.org/u/klaff)
#### Post date: [March 29, 2021, 1:06pm UTC](https://discourse.julialang.org/t/equally-dividing-a-circular-area/58151/3 "2021-03-29T13:06:36Z")

</div>

The sunflower thing is cool!

[Emitters · OpticSim.jl](https://microsoft.github.io/OpticSim.jl/stable/emitters/#OpticSim.HexapolarField) makes use of hexapolar ray fields. Maybe you can find something useful there.

---

<div class="post-metadata">

### Author: ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)
#### Post date: [March 29, 2021, 3:37pm UTC](https://discourse.julialang.org/t/equally-dividing-a-circular-area/58151/4 "2021-03-29T15:37:33Z")

</div>

@klaff, if you enjoy sunflowers, you will like [this article](https://www.geogebra.org/m/ZhbTtnb9).

---

<div class="post-metadata">

### Author: ![joa-quim](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/joa-quim/32/227_2.png) [@joa-quim](https://discourse.julialang.org/u/joa-quim)
#### Post date: [March 29, 2021, 7:14pm UTC](https://discourse.julialang.org/t/equally-dividing-a-circular-area/58151/5 "2021-03-29T19:14:32Z")

</div>

For Sunflowers see the last two examples in [Spirals · GMT](https://www.generic-mapping-tools.org/GMT.jl/dev/gallery/spirals/spirals/)

 ![image](https://global.discourse-cdn.com/julialang/original/3X/d/c/dcc0c9a42cf9e4f1a68faac3ddc7ec4811f96a7c.png)

---

<div class="post-metadata">

### Author: ![JuliusAurelius](https://avatars.discourse-cdn.com/v4/letter/j/a87d85/32.png) [@JuliusAurelius](https://discourse.julialang.org/u/JuliusAurelius)
#### Post date: [March 30, 2021, 8:36am UTC](https://discourse.julialang.org/t/equally-dividing-a-circular-area/58151/6 "2021-03-30T08:36:09Z")

</div>

That’s a really interesting publication and also seems to be quite easy to implement! Thank you!  
It is a shame that the LaTeX document seems to be one compilation away from including all citations, and that it isn’t easy to cite itself (year missing, no doi). I tried contacting the person, but the mail is not active anymore and I haven’t found another “mature” version of it.

---

<div class="post-metadata">

### Author: ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)
#### Post date: [March 30, 2021, 9:05am UTC](https://discourse.julialang.org/t/equally-dividing-a-circular-area/58151/7 "2021-03-30T09:05:32Z")

</div>

@JuliusAurelius , did you try emailing via the [university webpage](https://orbi.uliege.be/handle/2268/91953) (_by clicking on email icon displayed_) ?
