
Spirals and the Fibonacci Function 
One solution. 
Guest
Status:
Posts: n/a

One solution. 
11112006, 11:14 AM
See attached code for the recursive sequence generation. Some notes:
1. Technically, this doesn't violate the cheating policy since problem 77a, p. 209 in the Herbert text asks for pseudocode and this is the real thing. Still  comments anyone? (I'm not being a smart ass here  I really tried and couldn't figure out a way to explain this without posting the code.) 2. The algorithm is from a 20+ year old reference http://www.atarimagazines.com/creati...ay_to_skin.php that used Basic (ohh ) and a dreaded "GOTO" (ahh, gasp ). To get the recursive version, I just replaced the GOTO with the "obviously superior" (OK, I can be a smart ass ) recursive method call. The reference also gives a formula for calculating individual numbers in a Fibonacci sequence, although I haven't tried it. 3. To generate the spiral once you have the sequence, see http://library.thinkquest.org/27890/theSeries6a.html . Note that a spiral generated this way will have discontinuous second derivatives and will be a bit "herkyjerky." 


Efficiency? 
Thread Tools  
Display Modes  

