Project Folders
Teacher Resources
Student Resources
How Do I?
Site Map
Our Team

MWForum Message [Date Index] [Threads] [Authors] [Attachments] [Subscribe]

[Thread Prev] [Thread Next]

To: <mwforum@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: Teaching
From: "Jeff Knope" <jknope@xxxxxxxx>
Date: Sat, 11 Jun 2005 11:17:53 -0700

On June 10th Andrea asked:

So how was this done Jeff? A lot of the students at OWL really get excited
about making shapes and when I showed them how to make a star when I was
making spirals, it really caught their attention. I will soon be embarking
on introducing a team of student leaders (peer teachers) to new and fun
advanced ideas, and making stars seems like a good way to get them
interested as well as increasing thier knowledge in the program.

Hmmm.... "advanced" is a relative term. The Lineweaver program does it by making a list of the vertices of the user-supplied figure (regular or free-form), and uses that list to compute a new list of vertices of a concentric version of that figure, with a given offset.

I'd be happy to get into how to do that. But I suspect it would be a little overwhelming for all but very advanced secondary students. It requires familiarity with list-processing and tail-recursion, subjects that should be approached slowly and in a step-by-step way.

To do the job you describe (making concentric stars), there is a far simpler way. And this way has the nice feature of introducing some useful triginometry. Please follow this text while referring to the attached images.

The simplest way I know to draw a star is probably this:

to STAR :leg
pd seth -18
repeat 5 [fd :leg lt 144 fd :leg rt 72]

This works by first getting oriented (seth -18), and then 5 times drawing one point of the star and turning to be ready to draw the next point. (See the top pair of figures in the first attached image.)

Because the "origin" of the figure is one of its vertices, when you draw a bigger one with the same origin it is not concentric.

So what's required to make them concentric is to start (and finish) in the true "center" of the star. This requires computing the ratio of the distance from the center to the "start" point to the length of one leg. How to do that computation is shown in the second attached figure.

to STAR2 :sz     ;;; allows drawing concentric stars
make "here pos
make "leg (:sz * sin 36) / sin 18
pu seth 36 fd :sz seth -18 pd
repeat 5 [fd :leg lt 144 fd :leg rt 72]
pu setpos :here


Attachment: stars_gif.gif
Description: GIF image

Attachment: startrig.gif
Description: GIF image

  • Previous by thread: Re: Teaching
  • Next by thread: RE: Teaching

  • To save an attachment to your computer, PC users should right-click (Mac users, click and hold the mouse button) on the link and then choose 'save target as' from the pop-up menu. A window will then pop up in which you can choose a location for the file.

    © copyright 2001 - 2008