Calculating the Golden Spiral

Following up on a comment in the latest DevMeet; how to draw the Golden Spiral.

I did a quick search for “golden spiral code” and found this:

It illustrates how one use the Fibonacci sequence to generate the coordinates for drawing the arc segments for the spiral. I don’t have time to translate this to Ruby right now, but I’ll see if I have a spare minute tomorrow. (Unless someone else takes up the challenge? :wink:)

1 Like

This is the draw routine from a Sketchup tool someone requested years ago.

Golden Spiral.rb (2.3 KB)

Produces this image

1 Like

Using U-V PolyGen and the parametric equations:

x = u * Math.cos(10.0 * u) * Math::E**u
y = u * Math.sin(10.0 * u) * Math::E**u

where 0 <= u <= PI

Has a golden-spiral option…
It’s a bit old, but it’s RBZ contains RBS and RBE formats… so if you have the means the RB version is accessible…
But there’s probably some similar RB versions around too…

1 Like

Related: Very occasionally I’ve had SketchUp infer a golden section. How do you make it do that?

@Elmtec-Adam, sliding the cursor into guessed position with the ‘Rectangle’ tool.
Just like giving you a “square” indication when into position.

1 Like

I actually realised I should have googled it before I posted that. Thankyou