A newbie needs some help in squeak (maths, algorithm and drawing)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

A newbie needs some help in squeak (maths, algorithm and drawing)

Jerome Peace

Here is a different take on the same problem:

paste in a workspace select and do:


======>>



"Something to use to show results:"


arrow :=  [ :verticesCollection |
        (PolygonMorph arrowPrototype setVertices:
verticesCollection ) openCenteredInWorld ] .
               
" len was the number of steps. Which means rotations
should actually be  len / ppr. I just left it a whole
number for simplicity"

rotations  := 5 .
ppr := 10.

"What I couldn't resist is pointing out how deadly
simple squeak can make things. You just need to think
thru to the next iteration of the problem.'"

spiralVertices :=
(0 to: rotations * Float twoPi by: Float twoPi / ppr )
collect: [ :each |
        Point r: 0.15 * each sqrt degrees: each
radiansToDegrees ] .

 arrow value: spiralVertices * 50  .  


>>==========

Then play with the details.

Yours in curiosity and service, --Jerome Peace

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com