21
Jun
04

Golden Ratio Spiral Transformation

The Golden Ratio f = (1 + sqrt(5))/2 ≈ 1.61803 has an interesting relationship with Fibonacci Numbers. The basic equation for a Golden Spiral r(q) = f2q/p. The interlocking rings pattern in this image was adapted from M. C. Esher’s Snakes.
(* runtime: 48 seconds *)
image = Import["C:/Picture.jpg"][[1, 1]]/255.0; imax = Length[image]; jmax = Length[image[[1]]];
n = 275; phi = 0.5 (1 + Sqrt[5]);
Show[Graphics[RasterArray[Table[Module[{x = 2j/n - 1, y = 2i/n - 1, r, theta}, r = x^2 + y^2; theta = ArcTan[y, x]; RGBColor @@ If[r != 0, image[[Floor[imax Mod[2theta/Pi, 1]] + 1, Floor[jmax Mod[theta/Pi + 0.25Log[r]/Log[phi], 1]] + 1]], {0, 0, 0}]], {i, 1, n}, {j, 1, n}]], ImageSize -> n, PlotRange -> {{0, n}, {1, n}}, AspectRatio -> 1]]

Links

Advertisements

0 Responses to “Golden Ratio Spiral Transformation”



  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Welcome !

You will find here some of my favorite hobbies and interests, especially science and art.

I hope you enjoy it!

Subscribe to the RSS feed to stay informed when I publish something new here.

I would love to hear from you! Please feel free to send me an email : bugman123-at-gmail-dot-com

Archives

Blog Stats

  • 546,237 hits

%d bloggers like this: