# [IAEP] [etoys-dev] TED - Alan Kay - Example(8:44)

Edward Cherlin echerlin at gmail.com
Sun Feb 21 20:04:23 EST 2010

```Here is an SVG of the simplest proof of the Pythagorean theorem I
know, by dissection of a large square into five pieces that fit
together into two smaller squares side by side.

On Fri, Feb 19, 2010 at 23:22,  <forster at ozonline.com.au> wrote:
> I started trying to do something similar with Game Maker, a closed source but free visual language.
>
> The proof of Pythagoras was too hard for me so I settled for a demonstration
> see http://rupert.id.au/schoolgamemaker/samples3/
>
> It wouldnt be too hard to port to Turtle Art or Etoys
>
> Here's the code if it is of any use
>
> for (i=x1;i<=x2;i+=25)                          /* baseline   */
> {
>    draw_line(i,y1,i,y1+x2-x1)        /*base verticals */
>    draw_line(x1,i+y1-x1,x2,i+y1-x1)  /*base horizontals */
>
> }
> for (i=y1;i>=y2;i-=25)                           /*vertical */
> {
>    draw_line(x2-i+y1,y1,x2-i+y1,y2)   /*verticals*/
>    draw_line(x2,i,x2+y1-y2,i)                   /*horizontals*/
>
> }
> hyp=sqrt(sqr(y1-y2)+sqr(x2-x1))
> alpha=arctan2((y1-y2),(x2-x1))
> room_caption="Pythagoras' Theorem  horiz.="+string(sqr(x1-x2)/625)+
>    "squares   vert.="+string(sqr(y1-y2)/625)+"squares   hyp=" +string((sqr(x1-x2)+sqr(y1-y2))/625)+"squares"
> for(i=0;i<=hyp/25;i+=1)
> {
>    draw_line(x1-i*25*sin(alpha),y1-i*25*cos(alpha),        /*parallel*/
>        x2-i*25*sin(alpha),y2-i*25*cos(alpha))
>
>    draw_line(x1+i*25*cos(alpha),y1-i*25*sin(alpha),   /*perp*/
>        x1-hyp*sin(alpha)+i*25*cos(alpha),y1-hyp*cos(alpha)-i*25*sin(alpha))
>
> }
>
> Tony
> _______________________________________________
> IAEP -- It's An Education Project (not a laptop project!)
> IAEP at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/iaep
>

--
Edward Mokurai (默雷/धर्ममेघशब्दगर्ज/دھرممیگھشبدگر ج) Cherlin
Silent Thunder is my name, and Children are my nation.
The Cosmos is my dwelling place, the Truth my destination.
http://www.earthtreasury.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Pythagoras.svg
Type: image/svg+xml
Size: 6348 bytes
Desc: not available
Url : http://lists.sugarlabs.org/archive/iaep/attachments/20100221/8396f445/attachment.svg
```