<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>On second thought I suspect you have that much down and you fail to see how to branch of into the right direction at 1/n of the length and to the left at 1/k for k < n with different angles. </div><div><br></div><br><div><div>On Nov 13, 2010, at 10:09 AM, Matthias Felleisen wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>Here is a hint I posted some N years ago for my freshmen: </div><div><br></div><div><div>Recall the hint: "Think of the problem as drawing a straight line, given</div><div>its starting point and an angle in, say, radians." Graphically the situation</div><div>looks like this:</div><div><span><savanah.png></span></div><div><br></div><div>Your given the starting point (x0,y0) the _length_ and the angle _a_ and you want to add the red line to the picture. To do so, you need to figure out the length of the _green_ and _black_ lines. And they are: (* length (sin a)) and (* length (cos a)) respectively. Note that radian means </div><div>fractions of pi, e.g., (/ pi 6) for 30 degrees. </div></div><div><br></div><div><br></div><br><div><div>On Nov 12, 2010, at 10:00 PM, Ken Hegeland wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><table cellspacing="0" cellpadding="0" border="0"><tbody><tr><td valign="top" style="font: inherit;">I have a nearly working code, it draws the tree, but it is slightly off. I realize what is wrong that is causing the problem, for each recursive call I used a set angle. The tree draws all the left branches at the same angle and all right branches at the same angle. I end up with a picture of a tree with the left branch not having any more left branches, only right branches. The right side of the tree has only left branches, no right branches.<br><br>My first thought for gradually changing the angle is to use something like (- a 10) for the angle in one recursive call, and (+ a 10) in the next, but this produces a straight line with other lines way off to the right side. I am using a helper function which converts an angle from degrees in radians to help me more easily visualize where the branches should point. Is my thought process going in the correct
direction? If anyone wants to see the code I have feel free to email me, as always, thanks in advance for any help.<br></td></tr></tbody></table><br>
_________________________________________________<br> For list-related administrative tasks:<br> <a href="http://lists.racket-lang.org/listinfo/users">http://lists.racket-lang.org/listinfo/users</a></blockquote></div><br></div>_________________________________________________<br> For list-related administrative tasks:<br> <a href="http://lists.racket-lang.org/listinfo/users">http://lists.racket-lang.org/listinfo/users</a></blockquote></div><br></body></html>