Wednesday, 17 October 2012

Week 6: Paper Folding and "make-color"

I tried out with the paper folding. I marked down the folds I got after folding it the left corner to the right corner. It took me quite a while to read through the links and match the patterns with the folding.

For example, (D=DOWN, U=UP)

1st fold: D  (side view: \/ )
2nd fold: DDU (side view: \_/\ )
3rd fold: DDUDDUU
4th fold: DDUDDUUDDDUUDUU

We can also represent the number of down fold vertex found in that number of folds we made by this formula, 2^(n-1) wher n>=1.  
(n= number of times the strip of paper is folded)


1st fold: D=2^(1-1)= 1
2nd fold: D=2^(2-1)=2
3rd fold: D=2^(3-1)=4
4th fold: D=2^(4-1)=8
5th fold: D=2^(5-1)=16

(It is noted that he pattern is the representation of binary number system (base 2 system) where each fold represents the bits and the number of Ds represent the maximum value that bit can hold.)

I spent some time on the codes, the handout mentions the swapping between red, blue and green. 
(check-expect (rotate-red-blue-green c)
      (make-color
          (color-green c)
          (color-blue c)
          (color-red c)
          (color-alpha c)))
; 
(define (rotate-red-blue-green col)

Somehow I still found it pretty hard to relate the color change from the codes. I've assumed that 
- pic's red intensity --> assigned green intensity
- pic's green intensity --> assigned blue intensity
- pic's blue intensity --> assigned red intensity

It's bad that I got this after writing the quiz (if the above is correct).



No comments:

Post a Comment