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

Jerome Peace peace_the_dreamer at yahoo.com
Fri Apr 27 00:22:45 UTC 2007


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 



More information about the Squeak-dev mailing list