ANN: Stars

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

ANN: Stars

jim hurley
As LiveCode announcements go, this one is pretty low key. All "Stars" does is provide the code for drawing a star.

But there is a lesson for LiveCode to learn from the lowly five-pointed star, the one on the US flag.

A star may be viewed in two ways:

1)  Analytical Cartesian Geometry: A collection of 10 connected points (5 outside points, and 5 inside) in a  Cartesian coordinate system.

2)  Euclidian Geometry: A collection of lines and angles without reference to place or orientation.

The first is the Cartesian picture where the computation to draw the star is executed using algebra, trigonometry, and/or analytic geometry.

The other  picture is that of a figure in Euclidean space and the construction is carried out geometrically, drawing lines with a given angular relation to one another.

LiveCode favors the Cartesian picture employing its analytic tools to generate a list of 10 points and presenting the list as a graphic by setting the graphic to these points.

Here is how that code might look using those tools to draw a star in a Cartesian coordinate system:

>   --FIrst, define the angles and lengths in the figure to be drawn
>    put 36 into gamma
>    put 18 into alpha
>    put 200 into L
>    --Next some trig. Not trivial.
>
>    --Let r1 be the distance from the center of the star to the inner vertices.
>    put L*sine(alpha) /sine(gamma) into  r1
>
>    --Let r2 be the distance from the center to the outer vertices
>    put L*cosine(alpha) +  r1 * cosine(gamma) into r2
>
>    --Start at the top of the star at a polar angle of 90 degrees
>    put 90 into a
>    --Circle around the ten verticies of the star
>    --in increments of 360/10 = 36 degree, the polar angle between vertices.
>    put 36 into da
>    repeat with i = 1 to 10
>       if i mod 2 = 1 then
>          put r2* cosine(a) into x
>          put r2* sine(a)  into y
>          put round(x+ x0) into x
>          put round(-y+y0) into y
>          put x,y & cr after tPoints--outer points
>       else
>          put  r1* cosine(a) into x
>          put  r1* sine(a)  into y
>          put round(x+ x0) into x
>          put round(-y+y0) into y
>          put x,y & cr after tPoints--inner points
>       end if
>       add da to a -- next vertex
>       --If you want to see the star form line by line.
>       set the points of grc "Star" to tPoints
>       end repeat
>       --Close the loop
>       put results & line 1 of results into tPoints
>       set the points of grc "Star" to tPoints



And here is what the loop might look like if the star were expressed as a geometrical figure:

>     put 2*360/5 into tAngle -- Pretty simple geometry here.
>     put 200 into L
>     repeat with i = 1 to 5
>       forward L
>       right tAngle --at an exterior point
>       forward L
>       left tAngle/2 --at an interior point
>    end repeat


(After LC has  been taught how to execute "forward", "right", and "left".)

There has been talk for some time of promoting LC in education, even in K-12. Great idea.

There has also been talk, more broadly, of rejuvenating the teaching of mathematics --See the TED talk by Conrad Wolfram at:

    http://www.ted.com/talks/lang/en/conrad_wolfram_teaching_kids_real_math_with_computers.htmlConrad Wolfram

(Ken Ray will enjoy the stick figures at the end of the talk.)

From Wolfram's  talk: "I believe that correctly using computers is the silver bullet for making math education work."  He cites particularly the use of the computer in modeling and simulation. He anticipates scientists (geologist, biologists, engineers) programing these simulations.

LiveCode has all the necessary analytical tools for such modeling and simulation, but  it lacks the geometric tools, specifically Sprite Geometry (aka Turtle Graphics.)

For some years I have been promoting (spoken to Kevin on several occasions) the addition of Sprite geometry into LC. I believe it would add significantly to LC's penetration into the education market. It would allow kids to tackle problems that are much too difficult using Cartesian analytical tools, but quite straight forward when presented as problems in geometry--witness the "Star" above.

It would also allow them easy access to game programming. The loop to set a Fox graphic (control) chasing a Rabbit graphic (control) would look like this:

>  repeat until the mouseClick
>       tell "hare"
>       --Move Hare in a circle.
>       forward 2
>       left 1
>       put theLocation() into theHareLocation
>       tell "fox"
>       setheading direction(theHareLocation)
>       forward 1
>    end repeat


The Fox and Hare and treated as Sprites and Sprite geometry can talk to any LC control, a drawing sprite with penDown or not drawing with penUp.

Many are put off by Turtle Graphics. There is a perception that it is just for kids. But it goes well beyond simple ways to draw polygons. (See the book by Professor Harold Ableson of MIT titled: Turtle Geometry: The Computer as a Medium for Exploring Mathematics (Artificial Intelligence, at Amazon: http://www.amazon.com/Turtle-Geometry-Mathematics-Artificial-Intelligence/dp/0262510375/ref=sr_1_1?s=books&ie=UTF8&qid=1340373015&sr=1-1&keywords=Turtle+geometry . )

TG is also useful in  graphically solving trajectory equations (differential equations)  for the path of a projectile, or the motion of the Earth around the Sun. Or the surprising physics behind the rainbow--TG is quite straight forward in representing light rays in general, for they are quite simply lines that turn through angles.

Sprite geometry is wonderfully suited to doing calculus, differential and integral, both in formulating the problems geometrically and in coming up with quantitative solutions. As such it is a valuable educational tool.

As a trivial example of the advantage of Geometry over Analytics, I have illustrated these two approaches (Euclidian geometry vs. analytic geometry) in drawing the star at:

   go url "http://jamesphurley.com/RunRev/Stars.livecode"

The scripts there demonstrate the handicap that LiveCode faces in this very simple problem in geometry. LC has a problem. The fault, dear Brutus, may lie in our stars after all.



_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: ANN: Stars

Thomas McGrath III-3
Thanks Jim,

More information than I thought I needed to know about stars, but now I'm better informed. Very nice.

-- Tom McGrath III
http://lazyriver.on-rev.com
[hidden email]

On Jun 22, 2012, at 12:30 PM, Jim Hurley wrote:

> As LiveCode announcements go, this one is pretty low key. All "Stars" does is provide the code for drawing a star.
>
> But there is a lesson for LiveCode to learn from the lowly five-pointed star, the one on the US flag.
>
> A star may be viewed in two ways:
>
> 1)  Analytical Cartesian Geometry: A collection of 10 connected points (5 outside points, and 5 inside) in a  Cartesian coordinate system.
>
> 2)  Euclidian Geometry: A collection of lines and angles without reference to place or orientation.
>
> The first is the Cartesian picture where the computation to draw the star is executed using algebra, trigonometry, and/or analytic geometry.
>
> The other  picture is that of a figure in Euclidean space and the construction is carried out geometrically, drawing lines with a given angular relation to one another.
>
> LiveCode favors the Cartesian picture employing its analytic tools to generate a list of 10 points and presenting the list as a graphic by setting the graphic to these points.
>
> Here is how that code might look using those tools to draw a star in a Cartesian coordinate system:
>
>>  --FIrst, define the angles and lengths in the figure to be drawn
>>   put 36 into gamma
>>   put 18 into alpha
>>   put 200 into L
>>   --Next some trig. Not trivial.
>>
>>   --Let r1 be the distance from the center of the star to the inner vertices.
>>   put L*sine(alpha) /sine(gamma) into  r1
>>
>>   --Let r2 be the distance from the center to the outer vertices
>>   put L*cosine(alpha) +  r1 * cosine(gamma) into r2
>>
>>   --Start at the top of the star at a polar angle of 90 degrees
>>   put 90 into a
>>   --Circle around the ten verticies of the star
>>   --in increments of 360/10 = 36 degree, the polar angle between vertices.
>>   put 36 into da
>>   repeat with i = 1 to 10
>>      if i mod 2 = 1 then
>>         put r2* cosine(a) into x
>>         put r2* sine(a)  into y
>>         put round(x+ x0) into x
>>         put round(-y+y0) into y
>>         put x,y & cr after tPoints--outer points
>>      else
>>         put  r1* cosine(a) into x
>>         put  r1* sine(a)  into y
>>         put round(x+ x0) into x
>>         put round(-y+y0) into y
>>         put x,y & cr after tPoints--inner points
>>      end if
>>      add da to a -- next vertex
>>      --If you want to see the star form line by line.
>>      set the points of grc "Star" to tPoints
>>      end repeat
>>      --Close the loop
>>      put results & line 1 of results into tPoints
>>      set the points of grc "Star" to tPoints
>
>
>
> And here is what the loop might look like if the star were expressed as a geometrical figure:
>
>>    put 2*360/5 into tAngle -- Pretty simple geometry here.
>>    put 200 into L
>>    repeat with i = 1 to 5
>>      forward L
>>      right tAngle --at an exterior point
>>      forward L
>>      left tAngle/2 --at an interior point
>>   end repeat
>
>
> (After LC has  been taught how to execute "forward", "right", and "left".)
>
> There has been talk for some time of promoting LC in education, even in K-12. Great idea.
>
> There has also been talk, more broadly, of rejuvenating the teaching of mathematics --See the TED talk by Conrad Wolfram at:
>
>    http://www.ted.com/talks/lang/en/conrad_wolfram_teaching_kids_real_math_with_computers.htmlConrad Wolfram
>
> (Ken Ray will enjoy the stick figures at the end of the talk.)
>
> From Wolfram's  talk: "I believe that correctly using computers is the silver bullet for making math education work."  He cites particularly the use of the computer in modeling and simulation. He anticipates scientists (geologist, biologists, engineers) programing these simulations.
>
> LiveCode has all the necessary analytical tools for such modeling and simulation, but  it lacks the geometric tools, specifically Sprite Geometry (aka Turtle Graphics.)
>
> For some years I have been promoting (spoken to Kevin on several occasions) the addition of Sprite geometry into LC. I believe it would add significantly to LC's penetration into the education market. It would allow kids to tackle problems that are much too difficult using Cartesian analytical tools, but quite straight forward when presented as problems in geometry--witness the "Star" above.
>
> It would also allow them easy access to game programming. The loop to set a Fox graphic (control) chasing a Rabbit graphic (control) would look like this:
>
>> repeat until the mouseClick
>>      tell "hare"
>>      --Move Hare in a circle.
>>      forward 2
>>      left 1
>>      put theLocation() into theHareLocation
>>      tell "fox"
>>      setheading direction(theHareLocation)
>>      forward 1
>>   end repeat
>
>
> The Fox and Hare and treated as Sprites and Sprite geometry can talk to any LC control, a drawing sprite with penDown or not drawing with penUp.
>
> Many are put off by Turtle Graphics. There is a perception that it is just for kids. But it goes well beyond simple ways to draw polygons. (See the book by Professor Harold Ableson of MIT titled: Turtle Geometry: The Computer as a Medium for Exploring Mathematics (Artificial Intelligence, at Amazon: http://www.amazon.com/Turtle-Geometry-Mathematics-Artificial-Intelligence/dp/0262510375/ref=sr_1_1?s=books&ie=UTF8&qid=1340373015&sr=1-1&keywords=Turtle+geometry . )
>
> TG is also useful in  graphically solving trajectory equations (differential equations)  for the path of a projectile, or the motion of the Earth around the Sun. Or the surprising physics behind the rainbow--TG is quite straight forward in representing light rays in general, for they are quite simply lines that turn through angles.
>
> Sprite geometry is wonderfully suited to doing calculus, differential and integral, both in formulating the problems geometrically and in coming up with quantitative solutions. As such it is a valuable educational tool.
>
> As a trivial example of the advantage of Geometry over Analytics, I have illustrated these two approaches (Euclidian geometry vs. analytic geometry) in drawing the star at:
>
>   go url "http://jamesphurley.com/RunRev/Stars.livecode"
>
> The scripts there demonstrate the handicap that LiveCode faces in this very simple problem in geometry. LC has a problem. The fault, dear Brutus, may lie in our stars after all.
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: ANN: Stars

François Chaplais-3
In reply to this post by jim hurley
Your debate is pointless since you cannot do computer geometry without numbers, e.g. cartesian, or polar coordinates, or whatever. Besides, using angles requires a euclidian space, i.e. a space with an inner product, which is implemented in general by performing computations on coordinates.
Now, if you have a miracle solution for drawing Bezier curves in LiveCode, I am convinced (based on previous posts) that many (including me) will be happy to use it, as it is something that LC *cannot* do easily.
Best regards
        François Chaplais
Le 22 juin 2012 à 18:30, Jim Hurley a écrit :

> As LiveCode announcements go, this one is pretty low key. All "Stars" does is provide the code for drawing a star.
>
> But there is a lesson for LiveCode to learn from the lowly five-pointed star, the one on the US flag.
>
> A star may be viewed in two ways:
>
> 1)  Analytical Cartesian Geometry: A collection of 10 connected points (5 outside points, and 5 inside) in a  Cartesian coordinate system.
>
> 2)  Euclidian Geometry: A collection of lines and angles without reference to place or orientation.
>
> The first is the Cartesian picture where the computation to draw the star is executed using algebra, trigonometry, and/or analytic geometry.
>
> The other  picture is that of a figure in Euclidean space and the construction is carried out geometrically, drawing lines with a given angular relation to one another.
>
> LiveCode favors the Cartesian picture employing its analytic tools to generate a list of 10 points and presenting the list as a graphic by setting the graphic to these points.
>
> Here is how that code might look using those tools to draw a star in a Cartesian coordinate system:
>
>>  --FIrst, define the angles and lengths in the figure to be drawn
>>   put 36 into gamma
>>   put 18 into alpha
>>   put 200 into L
>>   --Next some trig. Not trivial.
>>
>>   --Let r1 be the distance from the center of the star to the inner vertices.
>>   put L*sine(alpha) /sine(gamma) into  r1
>>
>>   --Let r2 be the distance from the center to the outer vertices
>>   put L*cosine(alpha) +  r1 * cosine(gamma) into r2
>>
>>   --Start at the top of the star at a polar angle of 90 degrees
>>   put 90 into a
>>   --Circle around the ten verticies of the star
>>   --in increments of 360/10 = 36 degree, the polar angle between vertices.
>>   put 36 into da
>>   repeat with i = 1 to 10
>>      if i mod 2 = 1 then
>>         put r2* cosine(a) into x
>>         put r2* sine(a)  into y
>>         put round(x+ x0) into x
>>         put round(-y+y0) into y
>>         put x,y & cr after tPoints--outer points
>>      else
>>         put  r1* cosine(a) into x
>>         put  r1* sine(a)  into y
>>         put round(x+ x0) into x
>>         put round(-y+y0) into y
>>         put x,y & cr after tPoints--inner points
>>      end if
>>      add da to a -- next vertex
>>      --If you want to see the star form line by line.
>>      set the points of grc "Star" to tPoints
>>      end repeat
>>      --Close the loop
>>      put results & line 1 of results into tPoints
>>      set the points of grc "Star" to tPoints
>
>
>
> And here is what the loop might look like if the star were expressed as a geometrical figure:
>
>>    put 2*360/5 into tAngle -- Pretty simple geometry here.
>>    put 200 into L
>>    repeat with i = 1 to 5
>>      forward L
>>      right tAngle --at an exterior point
>>      forward L
>>      left tAngle/2 --at an interior point
>>   end repeat
>
>
> (After LC has  been taught how to execute "forward", "right", and "left".)
>
> There has been talk for some time of promoting LC in education, even in K-12. Great idea.
>
> There has also been talk, more broadly, of rejuvenating the teaching of mathematics --See the TED talk by Conrad Wolfram at:
>
>    http://www.ted.com/talks/lang/en/conrad_wolfram_teaching_kids_real_math_with_computers.htmlConrad Wolfram
>
> (Ken Ray will enjoy the stick figures at the end of the talk.)
>
> From Wolfram's  talk: "I believe that correctly using computers is the silver bullet for making math education work."  He cites particularly the use of the computer in modeling and simulation. He anticipates scientists (geologist, biologists, engineers) programing these simulations.
>
> LiveCode has all the necessary analytical tools for such modeling and simulation, but  it lacks the geometric tools, specifically Sprite Geometry (aka Turtle Graphics.)
>
> For some years I have been promoting (spoken to Kevin on several occasions) the addition of Sprite geometry into LC. I believe it would add significantly to LC's penetration into the education market. It would allow kids to tackle problems that are much too difficult using Cartesian analytical tools, but quite straight forward when presented as problems in geometry--witness the "Star" above.
>
> It would also allow them easy access to game programming. The loop to set a Fox graphic (control) chasing a Rabbit graphic (control) would look like this:
>
>> repeat until the mouseClick
>>      tell "hare"
>>      --Move Hare in a circle.
>>      forward 2
>>      left 1
>>      put theLocation() into theHareLocation
>>      tell "fox"
>>      setheading direction(theHareLocation)
>>      forward 1
>>   end repeat
>
>
> The Fox and Hare and treated as Sprites and Sprite geometry can talk to any LC control, a drawing sprite with penDown or not drawing with penUp.
>
> Many are put off by Turtle Graphics. There is a perception that it is just for kids. But it goes well beyond simple ways to draw polygons. (See the book by Professor Harold Ableson of MIT titled: Turtle Geometry: The Computer as a Medium for Exploring Mathematics (Artificial Intelligence, at Amazon: http://www.amazon.com/Turtle-Geometry-Mathematics-Artificial-Intelligence/dp/0262510375/ref=sr_1_1?s=books&ie=UTF8&qid=1340373015&sr=1-1&keywords=Turtle+geometry . )
>
> TG is also useful in  graphically solving trajectory equations (differential equations)  for the path of a projectile, or the motion of the Earth around the Sun. Or the surprising physics behind the rainbow--TG is quite straight forward in representing light rays in general, for they are quite simply lines that turn through angles.
>
> Sprite geometry is wonderfully suited to doing calculus, differential and integral, both in formulating the problems geometrically and in coming up with quantitative solutions. As such it is a valuable educational tool.
>
> As a trivial example of the advantage of Geometry over Analytics, I have illustrated these two approaches (Euclidian geometry vs. analytic geometry) in drawing the star at:
>
>   go url "http://jamesphurley.com/RunRev/Stars.livecode"
>
> The scripts there demonstrate the handicap that LiveCode faces in this very simple problem in geometry. LC has a problem. The fault, dear Brutus, may lie in our stars after all.
>
>
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: ANN: Stars

Alejandro Tejada
In reply to this post by jim hurley
Hi Jim,

Recently, I posted about my experience teaching a spanish
version of the course MetaTalk Programmer:
http://lists.runrev.com/pipermail/use-livecode/2012-June/173891.html

Could you tell us about your experience teaching
Turtle Graphics in the classroom?

How old were your students?

Did they have too much difficulty learning and applying
the course content?

I have read somewhere that experienced Abacus users
are able to make calculations in their mind, by visualising
their hands manipulating the Abacus in their imagination.

Could Turtle graphics students learn to visualise problem solving
in the same way, that is, using only their imagination without
using a computer simulation?

Al
Reply | Threaded
Open this post in threaded view
|

Re: ANN: Stars

Ken Corey
In reply to this post by jim hurley
Lovely analysis, and most accessible...

...but...you've provided great examples of turtle graphics in your stack.

Why should Mr. Miller and crew implement turtle graphics when it's quite
possible for an enterprising teacher such as yourself to provide a
library that does the same thing? (At least for the people you teach.)

Now, there'd be extra points for the RunRev team if they pushed a little
harder on instructions for how to make a library to put into RevOnline,
so future students could learn from it.

And I understand that there's trouble with RevOnline and uploading for
them to work on too.

I'd rather they spent the time it would take to make native turtle
graphics and spent it fixing RevOnline, and making sure we can all share.

-Ken

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: ANN: Stars

slylabs13
Amen brother!

Bob


On Jun 22, 2012, at 11:10 AM, Ken Corey wrote:

> Lovely analysis, and most accessible...
>
> ...but...you've provided great examples of turtle graphics in your stack.
>
> Why should Mr. Miller and crew implement turtle graphics when it's quite possible for an enterprising teacher such as yourself to provide a library that does the same thing? (At least for the people you teach.)
>
> Now, there'd be extra points for the RunRev team if they pushed a little harder on instructions for how to make a library to put into RevOnline, so future students could learn from it.
>
> And I understand that there's trouble with RevOnline and uploading for them to work on too.
>
> I'd rather they spent the time it would take to make native turtle graphics and spent it fixing RevOnline, and making sure we can all share.
>
> -Ken
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: ANN: Stars

Alejandro Tejada
In reply to this post by Ken Corey
Hi Ken,

Look at this website published by Jim Hurley:
http://home.infostations.net/jhurley/

Ken Corey wrote
[snip]
Why should Mr. Miller and crew implement turtle graphics when it's quite
possible for an enterprising teacher such as yourself to provide a
library that does the same thing? (At least for the people you teach.)
[snip]
I found really interesting that Jim wrote that learning Turtle Graphics
could be useful for anybody, not just children...

Where I could take an online Turtle Graphics course?

Al
Reply | Threaded
Open this post in threaded view
|

Re: ANN: Stars

Ken Corey
Even better: several Turtle graphics libraries, bezier graphics, and
more.  Thanks for the link, I might never have found his website.

This proves my point completely.

RunRev shouldn't bother re-implementing the stuff Jim (and you) have
done.  They should make sure it's easier to share it in the first place
(by making sure RevOnline is easy to use to share).

I would have found resources in RevOnline. In fact, the first thing I
did when I saw Jim's post was to go to RevOnline and see if anyone had
uploaded information about a Turtle library...and of course they hadn't.

Apple (and Google and soon Microsoft) has been showing everyone that
built-in stores are important.  It'd be a shame to let this one that
RunRev has built, and people have started to use, languish.

On 22/06/2012 23:06, Alejandro Tejada wrote:
> Look at this website published by Jim Hurley:
> http://home.infostations.net/jhurley/
[...]
> I found really interesting that Jim wrote that learning Turtle Graphics
> could be useful for anybody, not just children...
>
> Where I could take an online Turtle Graphics course?

I can't help but feel I'm the butt of a joke I don't understand here.

You can't google "turtle graphics course"?

-Ken

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: ANN: Stars

Alejandro Tejada
In reply to this post by François Chaplais-3
Hi Francois,

François Chaplais-3 wrote
[snip]
Now, if you have a miracle solution for drawing Bezier curves in LiveCode,
I am convinced (based on previous posts) that many (including me) will be
happy to use it, as it is something that LC *cannot* do easily.
[snip]
Actually, Jim have published a stack that draw Bezier curves in LiveCode:

http://www.jamesphurley.com/jhurleyFolder/BezierLine.rev
http://www.jamesphurley.com/jhurleyFolder/BezierCurves.rev

and myself have published many handlers to draw Bezier and Quadratic
curves (like those that Adobe Flash uses):

http://andregarzia.on-rev.com/alejandro/stacks/newPentoolScript_v02.zip
http://at.livecodejournal.com/stacks/newPentoolScript_v02.zip

http://andregarzia.on-rev.com/alejandro/stacks/CurvedDrawingPen_v01.zip
http://at.livecodejournal.com/stacks/CurvedDrawingPen_v01.zip

Many Thanks to Andre Garzia and Richard Gaskin for sharing space
in their servers for these stacks. :-)

Al
Reply | Threaded
Open this post in threaded view
|

Re: ANN: Stars

Alejandro Tejada
In reply to this post by Ken Corey
Hi Ken,

Ken Corey wrote
Even better: several Turtle graphics libraries, bezier graphics, and
more.  Thanks for the link, I might never have found his website.
Many years ago, when I started using this platform, one of my first
self-assignments was to download and read the complete
mail list archive:
http://lists.runrev.com/pipermail/use-livecode/

I decompressed the archives and keep them in a folder
where Notepad plus could search them, but after a while
it was easier to make my own stack to search and display
the messages:
http://andregarzia.on-rev.com/alejandro/stacks/Mailbox_browser.zip
http://at.livecodejournal.com/stacks/Mailbox_browser.zip

I am sure that there is a similar stack, published some time ago.

Ken Corey wrote
On 22/06/2012 23:06, Alejandro Tejada wrote:
> I found really interesting that Jim wrote that learning Turtle Graphics
> could be useful for anybody, not just children...
> Where I could take an online Turtle Graphics course?

I can't help but feel I'm the butt of a joke I don't understand here.
You can't google "turtle graphics course"?
Actually, Jim have the practical experience to separate the wheat from the chaff.
He could tell us which course is useful for this specific purpose.

Al
Reply | Threaded
Open this post in threaded view
|

Re: ANN: Stars

jim hurley
In reply to this post by jim hurley
Hi Alejandro,

I never taught such a course. I did write a book some time back: Turtle Physics, Holt, Reinhard, and Winston, 1985. Also in Spanish: Fisica con Logo.

That implementation of TG was in LOGO, not LiveCode.

LOGO was a product of the MIT multimedia lab and was an outgrowth of an MIT project based on Seymor Paper's work.

LOGO was based on LISP, the language of choice at MIT computer science dept. It works well for work for AI.

It was all about list processing. So much so that the only repeat structure was tail recursion. Recursion drove most teachers nuts.

The link on my web site to "Programing for science students" was an early effort to translate Turtle Physics into LiveCode, nee Transcript.

Jim


On Jun 23, 2012, at  4:46 AM, [hidden email] wrote:

> Message: 5
> Date: Fri, 22 Jun 2012 11:08:32 -0700 (PDT)
> From: Alejandro Tejada <[hidden email]>
> To: [hidden email]
> Subject: Re: ANN: Stars
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=us-ascii
>
> Hi Jim,
>
> Recently, I posted about my experience teaching a spanish
> version of the course MetaTalk Programmer:
> http://lists.runrev.com/pipermail/use-livecode/2012-June/173891.html
>
> Could you tell us about your experience teaching
> Turtle Graphics in the classroom?
>
> How old were your students?


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: ANN: Stars

jim hurley
In reply to this post by jim hurley
Alejandro,

I can't imagine where that (infostations) web address came from--times long gone by.

My current RunRev web address is: http://jamesphurley.com/Revolution.html

There are lots of books that teach TG, but they all use LOGO or LISP.

Jim


On Jun 23, 2012, at  4:46 AM, [hidden email] wrote:

> Message: 18
> Date: Fri, 22 Jun 2012 15:06:54 -0700 (PDT)
> From: Alejandro Tejada <[hidden email]>
> To: [hidden email]
> Subject: Re: ANN: Stars
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=us-ascii
>
> Hi Ken,
>
> Look at this website published by Jim Hurley:
> http://home.infostations.net/jhurley/
>
>
> Ken Corey wrote
>>
>> [snip]
>> Why should Mr. Miller and crew implement turtle graphics when it's quite
>> possible for an enterprising teacher such as yourself to provide a
>> library that does the same thing? (At least for the people you teach.)
>> [snip]
>>
>
> I found really interesting that Jim wrote that learning Turtle Graphics
> could be useful for anybody, not just children...
>
> Where I could take an online Turtle Graphics course?
>
> Al


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: ANN: Stars

jim hurley
In reply to this post by jim hurley
Hi Ken,

I agree with you about RevOnline being a priority.

Surly, if they haven't the time for that, they haven't the time to promote LC in education.

If that should ever happen, I believe TG would have to  be integral to LC, if it is to be taken seriously. Libraries do not provide the visibility needed.

Jim


On Jun 23, 2012, at  4:46 AM, [hidden email] wrote:

> Message: 6
> Date: Fri, 22 Jun 2012 19:10:57 +0100
> From: Ken Corey <[hidden email]>
> To: [hidden email]
> Subject: Re: ANN: Stars
> Message-ID: <[hidden email]>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Lovely analysis, and most accessible...
>
> ...but...you've provided great examples of turtle graphics in your stack.
>
> Why should Mr. Miller and crew implement turtle graphics when it's quite
> possible for an enterprising teacher such as yourself to provide a
> library that does the same thing? (At least for the people you teach.)
>
> Now, there'd be extra points for the RunRev team if they pushed a little
> harder on instructions for how to make a library to put into RevOnline,
> so future students could learn from it.
>
> And I understand that there's trouble with RevOnline and uploading for
> them to work on too.
>
> I'd rather they spent the time it would take to make native turtle
> graphics and spent it fixing RevOnline, and making sure we can all share.
>
> -Ken


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: ANN: Stars

Alejandro Tejada
In reply to this post by jim hurley
Hi Jim,

Looks like LOGO is alive and kickiing...
I just received this link :-O

http://www.cs.berkeley.edu/~bh/logo.html

3 complete books to read!

Al
Reply | Threaded
Open this post in threaded view
|

Re: ANN: Stars

François Chaplais-3
In reply to this post by Alejandro Tejada
Thanks Alejandro. The actual link is
http://www.jamesphurley.com/RunRev/BezierLine.rev
I will have a deep look at the stack and how it relates to interpolation.
Best regards
        François
Le 23 juin 2012 à 15:42, Alejandro Tejada a écrit :

> Hi Francois,
>
>
> François Chaplais-3 wrote
>>
>> [snip]
>> Now, if you have a miracle solution for drawing Bezier curves in LiveCode,
>> I am convinced (based on previous posts) that many (including me) will be
>> happy to use it, as it is something that LC *cannot* do easily.
>> [snip]
>>
>
> Actually, Jim have published a stack that draw Bezier curves in LiveCode:
>
> http://www.jamesphurley.com/jhurleyFolder/BezierLine.rev
> http://www.jamesphurley.com/jhurleyFolder/BezierCurves.rev
>
> and myself have published many handlers to draw Bezier and Quadratic
> curves (like those that Adobe Flash uses):
>
> http://andregarzia.on-rev.com/alejandro/stacks/newPentoolScript_v02.zip
> http://at.livecodejournal.com/stacks/newPentoolScript_v02.zip
>
> http://andregarzia.on-rev.com/alejandro/stacks/CurvedDrawingPen_v01.zip
> http://at.livecodejournal.com/stacks/CurvedDrawingPen_v01.zip
>
> Many Thanks to Andre Garzia and Richard Gaskin for sharing space
> in their servers for these stacks. :-)
>
> Al
>
> --
> View this message in context: http://runtime-revolution.278305.n4.nabble.com/ANN-Stars-tp4651129p4651165.html
> Sent from the Revolution - User mailing list archive at Nabble.com.
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: ANN: Stars

Alejandro Tejada
Hi Francois,

François Chaplais-3 wrote
Thanks Alejandro. The actual link is
http://www.jamesphurley.com/RunRev/BezierLine.rev
I will have a deep look at the stack and how it relates to interpolation.
Best regards
I used these 3 different Bezier drawing handlers in this stack:
http://andregarzia.on-rev.com/alejandro/stacks/Eps_Import_V04.zip

One handler is based in Don Lancaster's code,
other handler uses Matrices and another
handler uses the very first code that
I published many, many years ago...

Could you guess which is faster? :-)

Although I have not looked in detail, the stack
SVGL must have different handlers to draw
Quadratic and Bezier curves.

http://revonline2.runrev.com/stack/112/SVGL

NOTE:
global varBezierSegment contains
a series of coordinates points
that draw the graphic on the card.

for example:

145,234
146,236
148,239
149,241
150,244
etc...
 
global variables named a,b,c,d
contains four coordinates points
of the bezier segment

for example:
A segment of an Adobe illustrator file:
96 62 m
96 69 101 1555 107 1555 C

a = 96,62
b = 96,69
c = 101,1555
d = 107,1555

The field named fld "BezierResolution" and
the variable named "cde" should contain
a number from 16 to 800.
This is the number of rectilinear segments
in a bezier segment...

on bezier1
  global varBezierSegment,a,b,c,d
  put the first item of a into x1
  put the first item of d into x2
  put the first item of b into xa
  put the first item of c into xb
  put the second item of a into y1
  put the second item of d into y2
  put the second item of b into ya
  put the second item of c into yb
  put 0 into v1
 
  if there is a fld "BezierResolution" then put fld "BezierResolution" into cde
  if cde is not a number then put "32" into cde
 
  Repeat with i = 1 to cde -- a number from 16 to 800
    put i * ( 1 / cde ) into v1
    put 1 - v1 into v2
    put (x1 * (v2 ^ 3) + (3 * xa * v1 * v2 * v2) + (3 * xb * v1 * v1 * v2) + (x2 * (v1 ^ 3))) into x
    put (y1 * (v2 ^ 3) + (3 * ya * v1 * v2 * v2) + (3 * yb * v1 * v1 * v2) + (y2 * (v1 ^ 3))) into y
    if varBezierSegment is not empty then put last line of varBezierSegment into varTemp
    if x div 1,y div 1 <> varTemp then put x div 1,y div 1 & return after varBezierSegment
  end repeat
end bezier1
----------------------------------------------------------------
on bezier2

  /* this is the custom property bm1
  1,1 -1
  1,2 3
  1,3 -3
  1,4 1
  2,1 3
  2,2 -6
  2,3 3
  2,4 0
  3,1 -3
  3,2 3
  3,3 0
  3,4 0
  4,1 1
  4,2 0
  4,3 0
  4,4 0
  */

 /* this is the custom property bm2
  [p0]
  [p1]
  [p2]
  [p3]
  1,1 0
  1,2 0
  1,3 0
  1,4 0
  */
 
  /* this is the custom property bm3
  1,1 0
  2,1 0
  3,1 0
  4,1 0
  */

  global varBezierSegment,a,b,c,d
  put the first item of a into x1
  put the second item of a into y1
  put the first item of b into xa
  put the second item of b into ya
  put the first item of c into xb
  put the second item of c into yb
  put the first item of d into x2
  put the second item of d into y2
 
  put 0 into v1
 
  put the bm1 of me into qwe12
  split qwe12 by return and space

  put the bm2 of me into qwy12
  put the bm2 of me into qwx12
 
  put x2 into word 2 of line 1 of qwx12
  put xb into word 2 of line 2 of qwx12
  put xa into word 2 of line 3 of qwx12
  put x1 into word 2 of line 4 of qwx12
 
  put y2 into word 2 of line 1 of qwy12
  put yb into word 2 of line 2 of qwy12
  put ya into word 2 of line 3 of qwy12
  put y1 into word 2 of line 4 of qwy12
 
  split qwx12 by return and space
  split qwy12 by return and space
 
  if there is a fld "BezierResolution" then put fld "BezierResolution" into cde
  if cde is not a number then put "32" into cde
 
  Repeat with i = 1 TO cde
    put i * (1/cde) into v1
    put 1 - v1 into v2
   
    put the bm3 of me into qws12
    put v2^3 into word 2 of line 1 of qws12
    put v2^2 into word 2 of line 2 of qws12
    put v2 into word 2 of line 3 of qws12
    put 1 into word 2 of line 4 of qws12
   
    split qws12 by return and space
   
    put matrixMultiply(qwe12,qws12) into qwz12
    put matrixMultiply(qwx12,qwz12) into pX
    put matrixMultiply(qwy12,qwz12) into pY
   
    combine pX using space
    combine pY using space
   
    if varBezierSegment is not empty then put last line of varBezierSegment into varTemp
    if pX div 1,pY div 1 <> varTemp then put pX div 1,pY div 1 & return after varBezierSegment
   
  end repeat
end bezier2
----------------------------------------------------------------
on bezier3
  global varBezierSegment,a,b,c,d
 
  put the first item of a into x3
  put the second item of a into y3
  put the first item of b into x2
  put the second item of b into y2
  put the first item of c into x1
  put the second item of c into y1
  put the first item of d into x0
  put the second item of d into y0
  put 0 into v1
 
  put (x3 - 3 * x2 + 3 * x1 - x0) into A
  put (3 * x2 - 6 * x1 + 3 * x0) into B
  put (3 * x1 - 3 * x0)  into C
  put (x0) into D
  put (y3 - 3 * y2 + 3 * y1 - y0) into E
  put (3*y2 - 6 * y1 + 3 * y0) into F
  put (3 * y1 - 3 * y0) into G
  put (y0) into H
 
 if there is a fld "BezierResolution" then put fld "BezierResolution" into cde
  if cde is not a number then put "32" into cde

  Repeat with i = 1 to cde -- a number from 16 to 800
    put i * ( 1 / cde ) into v1
    put 1 - v1 into t
    put ((((A * t) + B)* t) + C) * t + D into x
    put ((((E* t) + F)* t) + G) * t + H into y
    if varBezierSegment is not empty then put last line of varBezierSegment into varTemp
    if x div 1,y div 1 <> varTemp then put x div 1,y div 1 & return after varBezierSegment
  end repeat
 
end bezier3

Have a nice weekend!

Al