python fun geometry

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

python fun geometry

roberto-3
Recently, i got a lot of fun going through the examples of turtle
geometry in Abelson & Di Sessa original book.
(As already stated in previous thread by me)
Also, i started translating from logo to python all the examples in
the first chapter.
I am over the third paragraph at the moment.
If anyone is interested in receiving the first whole bunch of these
nice codes, just tell me.


Now, i have a geometric question about what the authors write:
in sec 1.1.2 they say that the following logo code:

TO ARCR R DEG
            REPEAT DEG
                  FORWARD R
                  RIGHT 1

produce a circular arc as output, having "DEG" degrees and "R" radius;
and that it's true, actually;
if DEG = 180 the arc is a semicircumference and so on...

But, the "R" in the code is the single step forward the turtle does in
its path so i can't understand how this R can be seen as the radius of
the circular arc.
Any hint is very appreciated.

--
roberto
_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: python fun geometry

Vern Ceder
On Thu, Sep 16, 2010 at 1:46 PM, roberto <[hidden email]> wrote:
Now, i have a geometric question about what the authors write:
in sec 1.1.2 they say that the following logo code:

TO ARCR R DEG
           REPEAT DEG
                 FORWARD R
                 RIGHT 1

produce a circular arc as output, having "DEG" degrees and "R" radius;
and that it's true, actually;
if DEG = 180 the arc is a semicircumference and so on...

But, the "R" in the code is the single step forward the turtle does in
its path so i can't understand how this R can be seen as the radius of
the circular arc.
Any hint is very appreciated.

Going forward 1 pixel and then turning 1 degree (and then repeating 360 times) gives you as close to a circle as you can get on the screen. If you were go to forward 2 pixels, the circle will be less smooth, but the radius will be twice the size... and so on...

HTH,

Vern


 
--
roberto
_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig




--
This time for sure! 
   -Bullwinkle J. Moose 
----------------------------- 
Vern Ceder, Director of Technology 
Canterbury School, 3210 Smith Road, Ft Wayne, IN 46804 
[hidden email]; 260-436-0746; FAX: 260-436-5137 

The Quick Python Book, 2nd Ed - http://bit.ly/bRsWDW


_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig
Reply | Threaded
Open this post in threaded view
|

Re: python fun geometry

Daniel Ajoy-2
In reply to this post by roberto-3
> Now, i have a geometric question about what the authors write:
> in sec 1.1.2 they say that the following logo code:
>
> TO ARCR R DEG
>             REPEAT DEG
>                   FORWARD R
>                   RIGHT 1
>
> produce a circular arc as output, having "DEG" degrees and "R" radius;
> and that it's true, actually;
> if DEG = 180 the arc is a semicircumference and so on...
>
> But, the "R" in the code is the single step forward the turtle does in
> its path so i can't understand how this R can be seen as the radius of
> the circular arc.
> Any hint is very appreciated.


It is true that R specifies the radius of the arc, but it is not a measure of the radius of the arc:

If R is small the arc will have a small radius
If R is larger the arc will have a larger radius

But R is not the length of that radius.

Daniel

_______________________________________________
Edu-sig mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/edu-sig