[taos-glug] anyone still interested in Scheme?; "wave" coordinates

After a long lapse, I finally got out SICP and
started working again.   Today I got through
part of the "picture language" in Sect. 2.2.4.

(If you've forgotten what this is all about, look at
http://www.newmex.com/ar/taos-glug/index.html)

It puzzled me at first because SICP's didn't seem
to explain how to actually draw the lines, much less
the photo.

Eventually I figured out that I had to do that myself.
(See page 136:  "The details of how primitive . . .)

On my GNU/Linux system, I found it easy to
do the actual primitive drawing with PostScript.  I
wrote a function "draw-line" that generated a series
of PostScript commands for each segment.   Then
I displayed the image with gs.

If anyone is interested, I can detail how I did that.

I managed to get things to the point where I could
actually draw the waving figure.   Here are the
coordinates I used:

;; segment endpoints for waving stick figure
;; (x1 y1 x2 y2)
;; assumes a "unit square" as on page 134
;; left side
    (.2   0  .4  .5)
    (.4  .5  .4  .6)
    (.4  .6  .2  .5)
    (.2  .5  0   .6)
    (0   .8  .2  .65)
    (.2  .65 .4  .7)
    (.4  .7  .35 .8)
    (.35 .8  .4   1)

;; right side
    (.8  .0  .6  .5)
    (.6  .5  1   .2)
    (1   .4  .6  .7)
    (.6  .7  .65 .8)
    (.65 .8  .6  1)

;; legs
    (.4  0   .5  .4)
    (.5  .4  .6  0)


Other related posts: