I was hoping someone could help me out with a math problem.
I'm trying to make a logartihmic spiral out of line segments.
To do this, I specify the initial line segment length, an angle to adjust each segment by relative to the last, and a taper value which is the percentage of the last line segment's length that the next segment should be.
For example,
If:
Length# = 16
Taper# = 0.5 (ie, 50% size change)
Angle# = 22.5
Then each loop I would go:
Length# = Length# * Taper#
CurrentAngle# = CurrentAngle# + Angle#
So if I had four segments their lengths would be:
16, 8, 4, 2
And each would be at a 22.5 degree angle to the last.
Now here's my problem. I want to allow the ability to subdivide the curve. So if a subidivision of 1 is specified, the curve will have just 4 segments, but if a subdivision level of 2 is specified, each will be divided in half.
My problem is that if I divide each segment in half I then don't know how much to angle each segment relative to the last, and how long to make each segment to maintain the shape of the spiral, but make it smoother.
I can't just cut the angle in half. I've already considered that, and it would not maintain the shape of the curve. It seems I have to cut it in quarters when I cut the number of segments in half... So maybe I need to divide angle by subdivisions^2. I'm not sure. And I still don't know what to do about the length of each segment and the percentage of change.
Anyone got any ideas?
Btw, here's some info form mathworld on logarithmic spirals. Maybe someoen who understand the math better than I can make some sense of it in this context.
http://mathworld.wolfram.com/LogarithmicSpiral.html
I'm trying to make a logartihmic spiral out of line segments.
To do this, I specify the initial line segment length, an angle to adjust each segment by relative to the last, and a taper value which is the percentage of the last line segment's length that the next segment should be.
For example,
If:
Length# = 16
Taper# = 0.5 (ie, 50% size change)
Angle# = 22.5
Then each loop I would go:
Length# = Length# * Taper#
CurrentAngle# = CurrentAngle# + Angle#
So if I had four segments their lengths would be:
16, 8, 4, 2
And each would be at a 22.5 degree angle to the last.
Now here's my problem. I want to allow the ability to subdivide the curve. So if a subidivision of 1 is specified, the curve will have just 4 segments, but if a subdivision level of 2 is specified, each will be divided in half.
My problem is that if I divide each segment in half I then don't know how much to angle each segment relative to the last, and how long to make each segment to maintain the shape of the spiral, but make it smoother.
I can't just cut the angle in half. I've already considered that, and it would not maintain the shape of the curve. It seems I have to cut it in quarters when I cut the number of segments in half... So maybe I need to divide angle by subdivisions^2. I'm not sure. And I still don't know what to do about the length of each segment and the percentage of change.
Anyone got any ideas?
Btw, here's some info form mathworld on logarithmic spirals. Maybe someoen who understand the math better than I can make some sense of it in this context.
http://mathworld.wolfram.com/LogarithmicSpiral.html