Re: Line Tracing
Thank you very much for your helpful suggestions, Jim. I going to start by getting an understanding of TurtleGraphics and your TurtleGraphicDemo . . . right now! Roger, There is a real catch in solving the Foucault Pendulum problem. The equations of motion have no closed form solution. (Although there are approximate solutions for small amplitude and for small angular velocity.) But if you employ the method illustrated in the Turtle Graphics Demo you don't need the solution, you effectively solve the equations of motion with a very simple algorithm: repeat xNew = xOld + velocityOld*t velocityNew = velocityOld + acceleration*t (put the new x into the old x and draw the line) (put the new velocity into the old velocity) end repeat where t is some fixed small time increment, and the acceleration is a known function. If for simplicity you take t = 1 (sec), the TG code for *any* problem in dynamics is: Repeat forever --Or until you lose patience IncrementXY vx, vy add accx() to vx add accy() to vy end repeat The line IncrementXY vx,vy increments the x and y coordinates of the path by vx and vy, and simultaneously draws the line. It doesn't get much simpler. This becomes a template for solving *all* such problems in dynamics. You just have to write different acceleration functions depending on the physical circumstances. You can see why I am promoting Transcript/TG as a mean of teaching programing to high school science students. This algorithm is in effect the solution to the differential equation of motion by the method of finite differences, but I wouldn't tell anybody--they will shun you. May I suggest the two dimensional harmonic oscillator rather than the Foucault Pendulum. You get beautiful Lissajou figures (prettier than the Foucault path) which are open or closed depending on the ratio of the x and y spring constants. This is a very rich problem for exploration. Good luck. You look like you are having fun. Jim I am indeed having fun . . . combining two loves; RR scripting and Physics. Cheers, Roger ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Line tracing
Jim Hurley wrote: erik hansen wrote: always read the fine print. now i can't get it to open. which app is good to open this Simpletext doc? ahhh! RunRev is. hey, this is fun! Eric, I suspect the problem you are having is in converting the document from PC to Mac. Richard Gaskin has this nifty AppleTalk application he wrote to make the conversion painlessly. You just have to drag the document onto the icon and presto, PC to Mac conversion. I can send it to you off line if you can't find it on his web site--I am assuming it that is alright with Richard??? Absolutely, Jim. Thanks for helping to spread it around where it can be useful. -- Richard Gaskin Fourth World Media Corporation Developer of WebMerge 2.2: Publish any database on any site ___ [EMAIL PROTECTED] http://www.FourthWorld.com Tel: 323-225-3717 AIM: FourthWorldInc ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Line Tracing
Have you had a look at the 'move' command? It's at the heart of the RunRev Animation Manager, and you should be able to create a smooth movement by setting a series of points and letting the object travel along those points with a 'move' statement. Just a thought, Jan Schenkel. Yes Jan, the move command works well but again, it doesn't do what I'm trying to do. I not only want to move a graphic but I want it to trace a line behind it. Thanks, Roger ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Line Tracing
Thanks to all who have responded to this Line tracing thing. Here is another iteration. Date: Sat, 1 Feb 2003 04:51:22 -0800 To: [EMAIL PROTECTED] From: Jim Hurley [EMAIL PROTECTED] Subject: Line tracing I think I see the problem. It is not a difficulty with refreshing the screen but the very large sampling times in the trajectory equations. If you change add 1 to T to add .05 to T you will get a much smoother motion. At least it does on my PowerBook running OS 8.6 I have no problem with the motion . . . it's very smooth on my new iMac and several PC's I use. But you're right about the sampling time being a critical consideration. But I thought you wanted a line drawn in the wake of the graphic motion? Yes, that's exactly what I am trying to do. What I am trying to do reminds me of an oscilloscpoe where the persistence of the screen results in a line/trace from a moving spot on the screen. I couldn't try your sound effects. They should add a nice touch to the visual. I have seen discussions on this list of problems with sound effects timing; that could be a conflict for you. I can't help you there. Since you're interested, I've emailed you privately to offer the download of my stack along with it's sound files. I've experienced no timing problems with the sounds on my machines. You will find a number of these problems in dynamics illustrated in the demo on the RR web site on the Education page including the projectile motion you are working on as well as planetary motion, Kepler's 2nd law (planets sweep out equal areas in equal times), the voyager sling shot effect as it moved around Jupiter and others. The graphic I use there is the turtle, which I represent with an arrow icon, which allows me to show heading as well as position. But it is easily modified to move any one or more RR controls (buttons, fields, graphics, images, etc.). You have the option of leaving a line in the turtle's wake or not. I've briefly looked at your TurtleGraphicsDemo and I'm very impressed. I haven't had time to understand the Turtle aspect yet, but I will have a closer look. I've been toying with the idea of simulating a typical Science Museum Foucault Pendulum, where a beautiful pattern is traced in the sand by the pendulum. I would like to generate those patterns by running the equation of motion of the Foucault Pendulum. I think this is not going to be easy because if I recall correctly, this is a non-linear differential equation. But, I'm ignorant enough to proceed anyway. Thanks, Roger ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Line Tracing
--- Roger Guay [EMAIL PROTECTED] wrote: Thanks to all who have responded to this Line tracing thing. it is great that all of the geometry education interests are in touch with each other. improved code and less duplication of effort. = [EMAIL PROTECTED]http://www.erikhansen.org __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Line tracing
--- Richard Gaskin [EMAIL PROTECTED] wrote: Jim Hurley wrote: erik hansen wrote: always read the fine print. now i can't get it to open. which app opens this Simpletext doc? ahhh! RunRev is. hey, this is fun! Eric, I suspect the problem you are having is in converting the document from PC to Mac. Richard Gaskin has this nifty AppleTalk application he wrote to make the conversion painlessly. You just have to drag the document onto the icon and presto, PC to Mac conversion. I can send it to you off line if you can't find it on his web site--I am assuming it that is alright with Richard??? Absolutely, Jim. Thanks for helping to spread it around where it can be useful. shouldn't the RunRev people (when they get some time) have this nifty AppleTalk application installed on their site? = [EMAIL PROTECTED]http://www.erikhansen.org __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Line tracing
erik hansen wrote: Richard Gaskin has this nifty AppleTalk application he wrote to make the conversion painlessly. You just have to drag the document onto the icon and presto, PC to Mac conversion. I can send it to you off line if you can't find it on his web site--I am assuming it that is alright with Richard??? Absolutely, Jim. Thanks for helping to spread it around where it can be useful. shouldn't the RunRev people (when they get some time) have this nifty AppleTalk application installed on their site? It wouldn't be their doing -- I'd have to send it to them first. :) They have a great tools repository at http://www.RunRev.com/revolution/developers/developerdownloads/usercontribu tions.html and are quick about posting new submissions. I just hadn't thought of uploading it there. All I did was find a snippet off the Web and modified it for the Rev type code, and then compiled it to a droplet: on open theList tell application Finder set selectionLength to number of items of selection if selectionLength = 0 then say Nothing is [[emph +]] selected. else -- first change all the files selected set the creator type of every file of selection to Revo set the file type of every file of selection to RSTK end if end tell end open While this works great in OS 9 it fails in OS X, providing the Nothing is selected feedback. Hopoefully one of you AppleScript gurus can explain: Why would the method by which I'm obtaining the file list work perfectly in Classic but not in OS X? -- Richard Gaskin Fourth World Media Corporation Developer of WebMerge 2.2: Publish any database on any site ___ [EMAIL PROTECTED] http://www.FourthWorld.com Tel: 323-225-3717 AIM: FourthWorldInc ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Line tracing
Richard, It must be a bug in OS X. If you assign the value to a variable first, and then get the count, you actually get the right number. For example, if you select to documents in the Finder and do this: tell application Finder get the number of items of the selection end tell ...you get 0. But if you do this: tell application Finder copy the selection to mySel get the number of items of mySel end tell ... you get 2. Go figure... Ken Ray Sons of Thunder Software Email: [EMAIL PROTECTED] Web Site: http://www.sonsothunder.com/ - Original Message - From: Richard Gaskin [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, February 01, 2003 4:34 PM Subject: Re: Line tracing erik hansen wrote: Richard Gaskin has this nifty AppleTalk application he wrote to make the conversion painlessly. You just have to drag the document onto the icon and presto, PC to Mac conversion. I can send it to you off line if you can't find it on his web site--I am assuming it that is alright with Richard??? Absolutely, Jim. Thanks for helping to spread it around where it can be useful. shouldn't the RunRev people (when they get some time) have this nifty AppleTalk application installed on their site? It wouldn't be their doing -- I'd have to send it to them first. :) They have a great tools repository at http://www.RunRev.com/revolution/developers/developerdownloads/usercontribu tions.html and are quick about posting new submissions. I just hadn't thought of uploading it there. All I did was find a snippet off the Web and modified it for the Rev type code, and then compiled it to a droplet: on open theList tell application Finder set selectionLength to number of items of selection if selectionLength = 0 then say Nothing is [[emph +]] selected. else -- first change all the files selected set the creator type of every file of selection to Revo set the file type of every file of selection to RSTK end if end tell end open While this works great in OS 9 it fails in OS X, providing the Nothing is selected feedback. Hopoefully one of you AppleScript gurus can explain: Why would the method by which I'm obtaining the file list work perfectly in Classic but not in OS X? -- Richard Gaskin Fourth World Media Corporation Developer of WebMerge 2.2: Publish any database on any site ___ [EMAIL PROTECTED] http://www.FourthWorld.com Tel: 323-225-3717 AIM: FourthWorldInc ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Line tracing-now applescript
I just hadn't thought of uploading it there. All I did was find a snippet off the Web and modified it for the Rev type code, and then compiled it to a droplet: snip While this works great in OS 9 it fails in OS X, providing the Nothing is selected feedback. Hopoefully one of you AppleScript gurus can explain: Why would the method by which I'm obtaining the file list work perfectly in Classic but not in OS X? I cannot explain your script but here is one I use to change text files into BBEdit files (I find BBEdit very handy), I just modified it for Rev. Works here on 10.2.1 9.2 atb sims * on run tell application Finder set theList to selection if (count items in theList) = 1 then set theList to {} end if end tell MakeAppleAliases(theList) end run on open theList MakeAppleAliases(theList) end open on MakeAppleAliases(theList) set NoItemsSelectedFlag to true -- initialize the flag tell application Finder repeat with x in theList set NoItemsSelectedFlag to false try set the creator type of x to Revo set the file type of x to RSTK on error error There was an error converting the file. end try end repeat end tell if NoItemsSelectedFlag then display dialog You have not selected anything. end if end MakeAppleAliases -- --- http://EZPZapps.com [EMAIL PROTECTED] Software - Internet Development - Consulting ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Line Tracing
--- Jim Hurley [EMAIL PROTECTED] wrote: http://www.runrev.com/revolution/education/usercontributions.html so, how do you download this? = [EMAIL PROTECTED]http://www.erikhansen.org __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
RE: Line Tracing
http://www.runrev.com/revolution/education/usercontributions.html so, how do you download this? Click on the title Turtle Graphics Demo v1.0 Regards Gary Rathbone ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Line Tracing
--- Roger Guay [EMAIL PROTECTED] wrote: Sarah, Jim What I'm trying to do is trace a line in time as a ball is moved across the screen. Near as I can tell, I want the screen to update but not redraw (if that makes any sense?) I've done this in ToolBook on the PC but I much prefer to stay on my Mac. Here is a description of my stack: Create a vertical line and label it Yaxis and an horizontal line and Label it Xaxis such that they intersect and define the origin somewhere near the lower left corner of your stack. Create a brightly colored circle graphic and name it Ball. Create 2 fields, one for Theta so labeled which defines the angle from the horizon that the ball is being fired, and one for V so labeled which defines the velocity of the ball when fired. Create a Fire button and insert the following script: on MouseUp global V, Xo, Yo, Theta, T, X --put item 1 of the rect of graphic Yaxis into Xo. Yaxis is a vertical line and Xo,Yo define the origin of motion --put item 4 of the rect of graphic Yaxis into Yo. put field V into V try a value of about 27 in field V Put the value of field Theta into Theta try a value of 1.2 in field Theta set the loc of graphic mortor to Xo,Yo Graphic mortor is a small red round ball. show graphic mortor put 0 into T put xo into x put Yo into y play Mortor.aiff repeat while Y = Yo + 1 add 1 to T put the value of (Xo+V*cos(Theta)*T ) into x put the value of (Yo - V*sin(Theta)*T + .5*T^2 ) into Y set the loc of graphic mortor to X,Y wait 1 end repeat -- the rest of the script results in a silly explosion at the last location of the mortor --- play Boom.aiff hide graphic mortor set the loc of graphic Burst to x,Yo repeat 35 show graphic burst wait 1 hide graphic burst wait 1 end repeat end MouseUp Jim has actually provided a solution for me that works well if I insert wait .01 in his repeat loops. I can only assume it has something to do with processing speed of the computer (I'm using a high end iMac with OS X.) Without the wait command in the repeat loop, Jim's scripts are very choppy on my computer. Finally, as I say, Jim's solution works well but I think it would nevertheless be more elegant to do this as I have in ToolBook where one is able to stop the screen redraw. Thanks very much for joining in the fun, Roger Hi Roger, Have you had a look at the 'move' command? It's at the heart of the RunRev Animation Manager, and you should be able to create a smooth movement by setting a series of points and letting the object travel along those points with a 'move' statement. Just a thought, Jan Schenkel. = As we grow older, we grow both wiser and more foolish at the same time. (La Rochefoucauld) __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
RE: Line Tracing
This would require that I prevent the screen from updating while the graphic is in motion... Check out 'lockscreen' in the Rev help. Sounds like it'll do the job. Regards Gary Rathbone ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
re: Line Tracing
Thanks to Gary Rathbone and Jim Hurley for their suggestions, but the Lockscreen property does not work, and although Jim's script is very clever, it results in a very choppy motion compared to repeatedly setting the loc of an object via an equation of motion (such as a projectile.) Any other ideas? Thanks, Roger I would like to trace a line by moving a small brightly colored graphic (say via an equation of motion). This would require that I prevent the screen from updating while the graphic is in motion. I've done this in other APDs but I can't seem to find the way to do it in RR. Any ideas? Thanks and Cheers, Roger ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Line Tracing
Hi Roger, I'm not quite sure what it is you are trying to do. If you stop the screen from updating, you won't see your graphic move. It will appear to leap from the start position to the end. Do you want to see it follow a path, but not see anything else happen? If so, perhaps you should consider a sub-stack so there is nothing but your graphic in the window. If you want to end up with a line across the window, then I would recommend using a polygon graphic and setting it's points. This is quick to do in a script and the screen update only has to happen once, when you set the points of the graphic to the set of points that you have just calculated using your equation. If you want an example, let me know. Cheers, Sarah On Friday, January 31, 2003, at 01:55 pm, Roger Guay wrote: Thanks to Gary Rathbone and Jim Hurley for their suggestions, but the Lockscreen property does not work, and although Jim's script is very clever, it results in a very choppy motion compared to repeatedly setting the loc of an object via an equation of motion (such as a projectile.) Any other ideas? Thanks, Roger I would like to trace a line by moving a small brightly colored graphic (say via an equation of motion). This would require that I prevent the screen from updating while the graphic is in motion. I've done this in other APDs but I can't seem to find the way to do it in RR. Any ideas? Thanks and Cheers, Roger ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution