Re: webMathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg31598] Re: webMathematica
- From: Au Han Bin <auhb3 at cz3.nus.edu.sg>
- Date: Thu, 15 Nov 2001 05:52:32 -0500 (EST)
- References: <9qjjnd$j8a$1@smc.vnet.net> <9qrcm7$bvn$1@smc.vnet.net> <9sdkp4$5vh$1@smc.vnet.net> <9sgedl$93e$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi, I am a mathematica newbie with urgent problems with how to create a branching tree. i have a template for it. however, can someone show me a more efficient or understandable version of how to make a branching tree. (2) i also like to inquire if, i like to modify my algorithm, such that i can bend my last branch in a differnt angle that is a user input. Thank you for your guidance, regards, a desperate mathematica newbie rotate2d[a_, tht_, b_]:=b + {{Cos[tht],-Sin[tht]}, {Sin[tht],Cos[tht]}}.a; rotation=0.3; shrinkage=0.8; Clear[twinline]; twinline[Line[{start_, end_}]]:= {Line[{end, end + shrinkage rotate2d[end-start, rotation,{0,0}]}], Line[{end, end + shrinkage rotate2d[end -start, -rotation,{0,0}]}] } Show[Graphics[{ Line[{{0,0},{0,1}}],twinline[Line[{{0.,0.},{0.,1.}}]] }], AspectRatio->Automatic] Clear[doTwins]; doTwins[lines_]:=Flatten[Map[twinline,lines]] Show[Graphics[NestList[doTwins,{Line[{{0,-1},{3,-2}}]},4]], AspectRatio->Automatic, PlotRange->All]