LOGO-L> Sphere or bulb
Author Message
LOGO-L> Sphere or bulb

Hello Turtles,

I have found an old mail (dated October 23) from Mr. MHELHEFNY, with 4 methods to draw a sphere in MSWLogo 3D. There are Christmas coming, and I found that one more way to produce a sphere (i.e. a bulb for a Christmas Tree) may be useful.
This is a short and simple, I hope, procedure. It use only rudimentary turtle move commands and applies very little trigonometry. (I'm proud of this). The result, with appropriate PENCOLOR and PENSIZE, may be as attached. It should run in PERSPECTIVE mode, of course.

This is a procedure itself:

to sph4 :z :w :dx
localmake "om (180 / :z / :w)
localmake "fi arctan (1 / :z / 2 )
repeat (:z * :w) [up :fi fd :dx*sin (repcount * :om ) down :fi rt (360 / :w) ]
end

You may run it with :z=18 :w=18 :dx=30 for example and any starting turtle position.

There are 3 questions, which a demanding student may ask:
1-      Is it really a sphere ?
2-      Where is a centre?
3-      How to draw only a visible hemisphere?
I have no students, so I don't need to look for the answer.

Regards,
Andrzej B.

Sun, 04 Jun 2000 03:00:00 GMT
LOGO-L> Sphere or bulb

I like your spiral sphere, very XMAS looking.

This will draw a sphere as well with no trig. but without a
"grid".

repeat 18 [circle :rad rr 20]
end

You can draw the grid without using any trig.
Hint: Let logo do the trig for you.

See the solar.lgo example for how to draw the grid. But
it does use trig to do the horz. circles to form the grid.

Quote:

> Hello Turtles,

> I have found an old mail (dated October 23) from Mr. MHELHEFNY, with 4 methods to draw a sphere in MSWLogo 3D. There are Christmas coming, and I found that one more way to produce a sphere (i.e. a bulb for a Christmas Tree) may be useful.
> This is a short and simple, I hope, procedure. It use only rudimentary turtle move commands and applies very little trigonometry. (I'm proud of this). The result, with appropriate PENCOLOR and PENSIZE, may be as attached. It should run in PERSPECTIVE mode, of course.

> This is a procedure itself:

> to sph4 :z :w :dx
>  localmake "om (180 / :z / :w)
>  localmake "fi arctan (1 / :z / 2 )
>  repeat (:z * :w) [up :fi fd :dx*sin (repcount * :om ) down :fi rt (360 / :w) ]
> end

> You may run it with :z=18 :w=18 :dx=30 for example and any starting turtle position.

> There are 3 questions, which a demanding student may ask:
> 1-      Is it really a sphere ?
> 2-      Where is a centre?
> 3-      How to draw only a visible hemisphere?
> I have no students, so I don't need to look for the answer.

> Regards,
> Andrzej B.

>     ---------------------------------------------------------------

>                                Name: rkula.gif
>               Part 1.2         Type: GIF Image (image/gif)
>                            Encoding: base64
>                         Description: rkula.gif (Obraz GIF)

--
===============================================================

http://www.softronix.com/
The www page contains some very powerful educational software.
Our single most important investment is our kids.
---------------------------------------------------------------

Mon, 05 Jun 2000 03:00:00 GMT
LOGO-L> Sphere or bulb

Last part of my mail dropped out. It should look like this:

Hello Turtles,

I have found an old mail (dated October 23) from Mr. MHELHEFNY, with 4 methods to draw a sphere in MSWLogo 3D. There are Christmas coming, and I found that one more way to produce a sphere (i.e. a bulb for a Christmas Tree) may be useful.
This is a short and simple, I hope, procedure. It use only rudimentary turtle move commands and applies very little trigonometry. (I'm proud of this). The result, with appropriate PENCOLOR and PENSIZE, may be as attached. It should run in PERSPECTIVE mode, of course.

This is a procedure itself:

Quote:
>to sph4 :z :w :dx
> localmake "om (180 / :z / :w)
> localmake "fi arctan (1 / :z / 2 )
> repeat (:z * :w) [up :fi fd :dx*sin (repcount * :om ) down :fi rt (360 / :w) ]
>end

You may run it with :z=18 :w=18 :dx=30 for example and any starting turtle position.

There are 3 questions, which a demanding student may ask:
1-      Is it really a sphere ?
2-      Where is a centre?
3-      How to draw only a visible hemisphere?
I have no students, so I don't need to look for the answer.

Regards,
Andrzej B.