Generating a recursive Romanesco broccoli

Romanesco broccoli is an edible flower of the species Brassica oleracea which includes cabbage, broccoli, Brussel sprouts, cauliflower, collard greens, and numerous other “cultivars”. It was first documented in Italy (as broccolo romanesco) in the sixteenth century. In French it is known as chou Romanesco, which translates to “Romanesco cabbage”, but it is by no means a cabbage. The Germans call it Pyramidenblumenkohl, or “pyramid cauliflower”. Romanesco broccoli is what could be termed a self-similar vegetable. There are vegetables which are composed of smaller copies of themselves ad infinitum, or at least until some limit where the similarity breaks down.

Equiangular spirals (also known as logarithmic spiral, Bernoulli spiral, and logistique) describe a family of spirals. It is defined as a curve that cuts all radii vectors at a constant angle.

How do we build a visualization of this vegetable? In Processing of course! Here is the Processing code to generate the Romanesco broccoli. The first piece of code handles setting up the Processing environment, and defining constants like the Golden ratio, the number of florets. It also sets up the Processing draw() function, which executes drawRomanesco(), and takes a snapshot of the final picture.

The remainder of the code deals with the function drawRomanesco() [1].

This is a nice recursive function, which as the base case draws a circle, using the function ellipse(). The recursive case, sets up some parameters, then uses a loop to derive the florets, which internal to the loop, recursively calls itself. The depth of the Romanesco is controlled by the number of levels, which in the case of the example above is 3. The first level is the overall Romanesco with 60 florets, the second level builds each of 60 florets within those florets, and the third level builds the florets within the florets, within the florets. The resulting image of the Romanesco broccoli, is below, showing the Romanesco from above. Of course it is not perfect, because the florets on the real Romanesco are angled out from the main axis.

[1] Code derived from algorithm on


Are great writers born?

Are great writers born, or is it a skill that you learn over time? The same question is often asked of artists – can one teach oneself to become a great painter or architect, or is there something innately within a person.

Most people don’t find their inherent ability to write until later in life. One cannot expect a young adult in high school or even university to be a good writer. Yet for some reason we do. Having someone sit through years of classic English prose, and grammar  does not necessarily provide them with the skills to become a good writer. I barely remember any of those things they drummed into us in high school. I found the literature we studied boring – others may find Steinbeck’s “The Grapes of Wrath”,  or F. Scott Fitzgerald’s “The Great Gatsby” enduring – although their works do have meaning, they are often boring – at least for a teenager. This is partially to do with a lack of experience and understanding. One cannot expect a teenager to really understand the underlying message in many of these books, because they are lacking in life experience. You cannot expect a 18-year old in the first year of university to produce a critical piece of literature. Some might be able to, most won’t. It’s not their fault, it’s that they simply lack life experience to put things into perspective. Life experience is not the Internet, no amount of YouTube videos and social media feeds can replace the physical act of experiencing life. With age comes the realization of life’s rich mosaic. Getting older also means you can coalesce your experiences into your writing abilities.

Additionally we become better writers if we read. If you don’t read varied literature your writing skills will never improve. By varied literature I mean fiction, non-fiction, magazines, blogs, comics – anything really. The act of reading will subconsciously add words to your vocabulary, and you also absorb varied methods of writing. Reading only scientific literature will not make you a better writer, in fact it will have the opposite effect – scientific writing is often staid, and uninspiring. It never use to be like that – people in fields like computer science use to be able to write beautifully, Dijkstra is a great example (and often English was not even their mother language). However the likes of Dijkstra come from a different time. Of course some people don’t read that much because they live in houses devoid of books. They never experience the joy of reading a *real* book. My house is filled with books of every sort. I borrow cookbooks from the library just to read them. I read anthologies on cooking, books on woodworking techniques, books on architecture, history, trains, historical mysteries – a range of varying topics. Shelves of books fill every room. Not electronic books, real tangible reading material.

Writing is a skill that anyone can develop, it just takes time. Some people do their best writing sitting in a cafe, for others it is travelling on a train. I like the idea of sitting in a cottage in winter, in front of a roaring fireplace, watching the snow slowly drift to ground through the strands of birch trees. Just saying.