<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/mandalas/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://fronkonstin.com/2018/02/14/mandalas/"> R – Fronkonstin</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<div class="twitter-share"><a rel="nofollow" href="https://twitter.com/intent/tweet?url=https%3A%2F%2Ffronkonstin.com%2F2018%2F02%2F14%2Fmandalas%2F&via=aschinchon" class="twitter-share-button" target="_blank">Tweet</a></div>
<blockquote>
<p>Mathematics is a place where you can do things which you can’t do in the real world (Marcus Du Sautoy, mathematician)</p>
</blockquote>
<p>From time to time I have a look to some of my previous posts: it’s like seeing them through another’s eyes. One of my first posts was <a rel="nofollow" href="https://fronkonstin.com/2014/01/11/i-need-a-new-computer-to-draw-fractals/" target="_blank">this one</a>, where I draw fractals using the Multiple Reduction Copy Machine (MRCM) algorithm. That time I was not clever enough to write an efficient code able generate <em>deep</em> fractals. Now I am pretty sure I could do it using <code>ggplot</code> and I started to do it when I come across with the idea of mixing this kind of fractal patterns with Voronoi tessellations, that I have explored in some of my previous posts, like <a rel="nofollow" href="https://fronkonstin.com/2017/03/07/frankenstein/" target="_blank">this one</a>. Mixing both techniques, the mandalas appeared.</p>
<p>I will not explain in depth the mathematics behind this patterns. I will just give a brief explanation:</p>
<ul>
<li>I start obtaining <code>n</code> equidistant points in a unit circle centered in <code>(0,0)</code></li>
<li>I repeat the process with all these points, obtaining again <code>n</code> points around each of them; the radius is scaled by a factor</li>
<li>I discard the previous (parent) <code>n</code> points</li>
</ul>
<p>I repeat these steps iteratively. If I start with n points and iterate k times, at the end I obtain n<sup>k</sup> points. After that, I calculate the Voronoi tesselation of them, which I represent with <code>ggplot</code>.</p>
<p>This is an example:</p>
<p><img data-orig-file="https://i2.wp.com/fronkonstin.com/wp-content/uploads/2018/02/image_3_12_2.80604255076032.png?fit=3000%2C3000&amp;ssl=1" data-orig-size="3000,3000" data-medium-file="https://i2.wp.com/fronkonstin.com/wp-content/uploads/2018/02/image_3_12_2.80604255076032.png?fit=300%2C300&amp;ssl=1" data-attachment-id="4406" data-image-meta="{" data-image-description="" src="https://i2.wp.com/fronkonstin.com/wp-content/uploads/2018/02/image_3_12_2.80604255076032.png?resize=604%2C604&ssl=1" data-permalink="https://fronkonstin.com/2018/02/14/mandalas/image_3_12_2-80604255076032/" data-large-file="https://i2.wp.com/fronkonstin.com/wp-content/uploads/2018/02/image_3_12_2.80604255076032.png?fit=604%2C604&amp;ssl=1" alt="" data-image-title="image_3_12_2.80604255076032" sizes="(max-width: 604px) 100vw, 604px" width="450" data-comments-opened="1" class="wp-image-4406" data-recalc-dims="1"></p>
<p>Some others:</p>
<p><img src="https://i1.wp.com/fronkonstin.com/wp-content/uploads/2018/02/image5.png?w=604&ssl=1" data-recalc-dims="1"></p>
<p><img src="https://i2.wp.com/fronkonstin.com/wp-content/uploads/2018/02/image2.png?w=604&ssl=1" data-recalc-dims="1"></p>
<p><img src="https://i2.wp.com/fronkonstin.com/wp-content/uploads/2018/02/image_4_6_4.3942398496205.png?w=604&ssl=1" data-recalc-dims="1"></p>
<p><img src="https://i0.wp.com/fronkonstin.com/wp-content/uploads/2018/02/image_4_5_0.5.png?w=604&ssl=1" data-recalc-dims="1"></p>
<p><img src="https://i2.wp.com/fronkonstin.com/wp-content/uploads/2018/02/image_3_7_1.6.png?w=604&ssl=1" data-recalc-dims="1"></p>
<p><img src="https://i0.wp.com/fronkonstin.com/wp-content/uploads/2018/02/image_3_6_3.86411544354633.png?w=604&ssl=1" data-recalc-dims="1"></p>
<p><img src="https://i1.wp.com/fronkonstin.com/wp-content/uploads/2018/02/image_2_20_0.277739710314199.png?w=604&ssl=1" data-recalc-dims="1"></p>
<p><img src="https://i1.wp.com/fronkonstin.com/wp-content/uploads/2018/02/image_2_17_4.76588788467925.png?w=604&ssl=1" data-recalc-dims="1"></p>
<p><img src="https://i2.wp.com/fronkonstin.com/wp-content/uploads/2018/02/image_2_8_0.29189550713636.png?w=604&ssl=1" data-recalc-dims="1"></p>
<p>You can find the code <a rel="nofollow" href="https://github.com/aschinchon/mandalas" target="_blank">here</a>. Enjoy it.</p>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://fronkonstin.com/2018/02/14/mandalas/"> R – Fronkonstin</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/jSo31Q5IZAY" height="1"></a></div>