REVO2700  Temperature xWon preopenstack --set the defaultmenubar to the short name of group "A paradox" of stack "A paradox in time" set the menubar of this stack to "" end preopenstack on openstack --set the defaultmenubar to the short name of group "A paradox" of stack "A paradox in time" set the menubar of this stack to "" end openstack v|e7749,302 741,305 719,308 734,310 748,303 764,300 780,299 QdotHome740,315Path6742,310 741,306 719,308 734,310 748,30 764,300 780,299pClass!55,6,-3,2 303,100,2,3 320,127,3,6WGeneva$WGeneva WTimes UTimes UGeneva WGeneva UGeneva WGeneva U New York W New York W New York WArialWTimesWGenevaWGeneva UTimes UTimesUTimesWTimes UTimesUTimes Ums sans serif UGeneva UTimes UGeneva ULucida Grande @UTimes PUTimesQDa8 cREVGeneral debugObjectsbutton id 1075 of card id 1057 of stack "Pardox in time" button id 1888 of card id 1965 of stack "Pardox in time" graphic id 1899 of card id 1965 of stack "Pardox in time" group id 1983 of card id 1965 of stack "Pardox in time" graphic id 1969 of card id 1965 of stack "Pardox in time" graphic id 1968 of card id 1965 of stack "Pardox in time" field id 2139 of card id 1965 of stack "Paradox in time applications" bookmarks handlerListpreopenstack openstack tempScript prevHandler openstackscriptSelectionchar 176 to 187script! PAron label inputText,lableField Lock screen -- put the tool into tTool -- choose the browse tool -- set the textstyle of the templateField to "bold" -- set the style of the templateField to "transparent" -- set the textAlign of templateField to center --set the dontWrap of templateField to true --put "fieldLabel" & labelCount into nField put LableField into tFieldName if there is no field tFieldName then create field tFieldName --add 1 to labelCount put inputText into field tFieldName put turtlePtTOMousePt(xycor()) into tLabelLoc set the loc of field tFieldName to Item 1 of tLabelLoc,Item 2 of tLabelLoc - 10 set the width of field tFieldName to the formattedwidth of field tFieldName set the height of field tFieldName to the formattedHeight of field tFieldName --set the tool to tTool --unLock screen end label on clearLabel labelField if there is no field labelField then create field labelField put "" into field labelField -- repeat with i = the number of fields down to 1 -- if labelField is in the name of field i then delete field i -- end repeat end clearLabel on preopencard Lock screen set the scroll of field "instructions" to 0 set the scroll of field "data" to 0 send "mouseUP" to button "drawcurves" --send "mouseUP" to button "slope1" --send "mouseUP" to button "slope3" --Lock screen end preopencard local angl,penDown,x,y global radPerDeg,degPerRad,noDraw,waittime,x0,y0 local x1,y1,A1,gpoints,tObject,tGraphic,labelCount --You may be puzzle by "drag from 0,0 to 0,0" in the handlers below, and "set the Lockscreen to true" --Don't ask. on back temp forward -temp end back on bk temp back temp end bk on centeredCircle r put the tool into savedTool choose the oval tool set the centered to true drag from round(x0+the px of tObject ),round(y0-the py of tObject) to round(x0+the px of tObject+r),round(y0-the py of tObject-r) set the centered to false choose the savedTool end centeredCircle function commaFormat pNum put pNum mod 1 into remainder delete char 1 of remainder put trunc(pNum) into pNum put the number of chars in pNum into n repeat with i = 1 to trunc((n-1)/3) put comma after char n - 3*i of pNum end repeat return pNum& remainder end commaformat function getTheObject who put theControls() into tList put "" into results repeat for each line tLine in tList--with i = 1 to the number of lines in tList if who is in tLine and "grc" is not in tLine then --line i of tList then put tLine into results--line i of tList into results exit repeat end if end repeat put results into tObject put quote before word 2 of tObject put quote after tObject return tObject end getTheObject function fact n put 1 into results repeat with i = 1 to n multiply results by i end repeat return results end fact on startTurtle theObject put round(the width of this stack/2) into x0 put round(the height of this stack/2) into y0 put "graphic" &&theObject into tObject put 1 into labelCount if there is no tObject then set the style of the templateGraphic to "line" create grc word 2 of tObject end if if the style of tObject is not "line" then set the style of tObject to "line" set the px of tObject to 0 set the py of tObject to 0 set the pPenDown of tObject to true set the pAngle of tObject to 0 set the pPoints of tObject to x0,y0 & return end startTurtle drawAndMove end startTurtle on st temp startTurtle temp end st --function intersection p1,p2,pp1,pp2 -- put item 1 of p1 into x1 -- put item 2 of p1 into y1 -- put item 1 of p2 into x2 -- put item 2 of p2 into y2 -- put item 1 of pp1 into xp1 -- put item 2 of pp1 into yp1 -- put item 1 of pp2 into xp2 -- put item 2 of pp2 into yp2 -- if x1 = x2 or xp1 = xp2 then -- if x1 = x2 then -- return x1&comma&yp2 + (x1-xp2)*(yp2-yp1)/(xp2-xp1) -- else -- return xp2&comma& y2 + (xp1-x2)*(y2-y1)/(x2-x1) -- end if -- end if -- put yp2 - y2 + x2*(y2-y1)/(x2 - x1) - xp2*(yp2 - yp1)/(xp2 - xp1) into numerator -- put ((y2 - y1)/(x2 - x1) -(yp2 - yp1)/(xp2-xp1)) into denom -- put numerator / denom into x -- put y2 + (x-x2) *(y2-y1)/(x2-x1) into y -- return x & comma & y --end intersection function intersection p1,p2,pp1,pp2 get the paramcount if it is 1 then put item 4 of p1 into pp2 put item 3 of p1 into pp1 put item 2 of p1 into p2 put item 1 of p1 into p1 end if put item 1 of p1 into x1 put item 2 of p1 into y1 put item 1 of p2 into x2 put item 2 of p2 into y2 put item 1 of pp1 into xp1 put item 2 of pp1 into yp1 put item 1 of pp2 into xp2 put item 2 of pp2 into yp2 --Check if the lines are parallel and deal with it somehow if (y2-y1)*(xp2-xp1) = (yp2-yp1)*(x2-x1) then add .0000001 to x2 if x1 = x2 or xp1 = xp2 then if x2 = x1 then return x1&comma&yp2 + (x1-xp2)*(yp2-yp1)/(xp2-xp1) else return xp2&comma& y2 + (xp1-x2)*(y2-y1)/(x2-x1) end if end if put yp2 - y2 + x2*(y2-y1)/(x2 - x1) - xp2*(yp2 - yp1)/(xp2 - xp1) into numerator put ((y2 - y1)/(x2 - x1) -(yp2 - yp1)/(xp2-xp1)) into denom put numerator / denom into x put y2 + (x-x2) *(y2-y1)/(x2-x1) into y return x & comma & y end intersection on setHome xx,yy get the paramcount if it is 1 then put item 2 of xx into yy put item 1 of xx into xx end if put (the width of this stack)/2 + xx into x0 put (the height of this stack)/2 - yy into y0 -- drawturtle end setHome on home setxy 0,0 set the pAngle of tObject to 0 end home function log x return ln(x)/ln(10) end log on cleanG who put who into temp get the paramcount if it is 0 then repeat with i = 1 to the number of graphics if "grc" is in the name of grc i then set the points of grc i to "" end repeat else set the pPoints of graphic who to "" set the points of graphic who to "" end if end cleanG on clearLabels who Lock screen get the paramcount if it is 0 then repeat with i = the number of fields down to 1 if "label" is in the name of field i then delete field i end repeat end if if it is 1 then repeat with i = the number of fields down to 1 if "who" is in the name of field i then delete field i end repeat end if -- unLock screen end clearLabels on cleanT who put who & "grc" into tGraphic if there is a grc tGraphic then set the points of grc tGraphic to "" end cleanT function perpBisector p1,p2 breakpoint pu setXY p1 seth toward( p2) fd .5*distancePt (p2) rt 90 put point into temp1 put item 1 of temp1 into item 1 of temp put item 2 of temp1 into item 2 of temp put heading() into item 3 of temp pd return temp end perpBisector on clean ct Lock screen repeat until the number of images is 0 delete image 1 end repeat put 1 into i repeat while i <= the number of fields if "fieldLabel" is in word 2 of the name of field i then delete field i else add 1 to i end repeat -- unLock screen end clean on incXY dx,dy -- put the px of tObject into x -- put the py of tObject into y put the pPoints of tObject into gPoints if the pPendown of tObject is true then put round (x0 +the px of tObject +dx) &comma &round(y0 -the py of tObject - dy)& return after gPoints else put return & round (x0 +the px of tObject +dx) &comma &round(y0 - the py of tObject - dy)& return after gPoints end if set the px of tObject to the px of tObject + dx set the py of tObject to the py of tObject + dy set the pPoints of tObject to gPoints --set the points of grc tGraphic to gPoints drawAndMove end incXY on setxy xnew,ynew get the paramCount if it = 1 then put item 2 of xnew into ynew put item 1 of xnew into xnew end if set the px of tObject to xnew set the py of tObject to ynew put the pPoints of tObject into gPoints put round(the px of tObject +x0)&comma& round(y0 - the py of tObject) into tLoc if the pPendown of tObject is true then --put truncItems(tLoc) into tLoc put tLoc & return after gPoints else put return & tloc & return after gPoints end if set the pPoints of tObject to gPoints DrawAndMove --set the lockscreen to false end setxy function truncItems tItem return round(item 1 of tItem)& comma&round(item 2 of tItem) end truncItems on setRA tRadius, tAngle put tRadius*cosine(tAngle) into tx put tRadius*sine(tAngle) into ty setXY tX,tY end setRA on drawAndMOve set the points of tObject to the pPoints of tObject --wait 0 millisec --set the points of graphic tGraphic to the pPoints of tObject --set the loc of tObject to round(x0 +the px of tObject)&comma&round(y0-the py of tObject) end drawAndMOve on setHeading temp seth temp end setHeading on drawTurtle end drawTurtle on seth anglnew set the pAngle of tObject to anglnew --drawTurtle end seth on left dangl lt dangl end left on right dangl rt dangl end right on rt dangl set the pAngle of tObject to the pAngle of tObject - dangl --drawTurtle end rt on lt dangl set the pAngle of tObject to the pAngle of tObject + dangl end lt on forward distance put distance * cos(radPerDeg * the pAngle of tObject) into dx put distance * sin(radPerDeg * the pAngle of tObject) into dy set the px of tObject to the px of tObject + dx set the py of tObject to the py of tObject + dy put the pPoints of tObject into gPoints put round(the px of tObject +x0)&comma&round(y0- the py of tObject) into tMouseLoc if the pPenDown of tObject is true then put tMouseLoc &return after gPoints else put return & round(the px of tObject+x0)&comma&round(-the py of tObject+y0)& return after gPoints end if set the points of tObject to gPoints set the pPoints of tObject to gPoints --set the loc of tObject to tMouseLoc end forward on fd temp forward temp end fd on pu set the pPenDown of tObject to false end pu on penUp pu end penUp on penDown pd end penDown on pd set the pPendown of tObject to true end pd function toward xtemp,ytemp get the paramCount if it is 1 then put item 2 of xtemp into ytemp put item 1 of xtemp into xtemp end if put ytemp - y into dy put xtemp - x into dx if dx = 0 then if dy > 0 then return 90 else return 90 + 180 end if if dy = 0 then if dx > 0 then return 0 else return 180 end if put degPerRad * atan(abs(dy) / abs(dx)) into angl if dy > 0 then if dx > 0 then return angl else return 180 - angl end if if dx > 0 then return 360 - angl else return 180 + angl end if end toward function direction xtemp,ytemp put the px of tObject into x put the py of tObject into y get the paramCount if it is 1 then put item 2 of xtemp into ytemp put item 1 of xtemp into xtemp end if put ytemp - y into dy put xtemp - x into dx if dx = 0 then if dy > 0 then return 90 else return 90 + 180 end if if dy = 0 then if dx > 0 then return 0 else return 180 end if put degPerRad * atan(abs(dy) / abs(dx)) into tAngl if dy > 0 then if dx > 0 then return tAngl else return 180 - tAngl end if if dx > 0 then return 360 - tAngl else return 180 + tAngl end if end direction function direction2 xtemp,ytemp get the paramCount if it is 1 then put item 2 of xtemp into ytemp put item 1 of xtemp into xtemp end if put ytemp - y into dy put xtemp - x into dx put arctangent2(dy,dx) into tAngle if tAngle < 0 then return 360 + tAngle else return tAngle end direction2 function xycor return (the px of tObject) & comma & (the py of tObject) end xycor function sci pNum,sigFigures if pNum < 0 then put "-" into sign else put empty into sign put abs(pNum) into pNum if sigFigures is empty then put 3 into sigFigures --Default significant figures. put 0 into count if pNum >= 1 then repeat until pNum < 10 divide pNum by 10 add 1 to count end repeat put round((10^(sigFigures-1))*pNum)/10^(sigFigures-1) into pNum return sign & (char 1 to sigFigures + 1 of pNum) &"*10^" & count end if if pNum < 1 then repeat until pNum >= 1 multiply pNum by 10 add 1 to count end repeat end if return sign & (char 1 to sigFigures + 1 of pNum) & "*10^-" & count end sci function xcor return the px of tObject end xcor function ycor return the py of tObject end ycor function randomInRange b,t return random(t-b+1) + b-1 end randomInRange on setx xnew setxy xnew, the py of tObject end setx on sety ynew setxy the px of tObject, ynew end sety function distance xtemp,ytemp get the paramCount if it = 1 then put item 2 of xtemp into ytemp put item 1 of xtemp into xtemp end if return sqrt ((the px of tObject -xtemp)^2 + (the py of tObject-ytemp)^2) end distance function heading put the pAngle of tObject into tempAngle --set the pAngle of tObject to the pAngle of tObject - dangl repeat while tempAngle >360 subtract 360 from tempAngle end repeat repeat while tempAngle < 0 add 360 to tempAngle end repeat return tempAngle end heading --on label inputText -- Lock screen -- put the tool into tTool -- choose the browse tool -- set the textstyle of the templateField to "bold" -- set the style of the templateField to "transparent" -- set the textAlign of templateField to center -- --set the dontWrap of templateField to true -- --put "fieldLabel" & labelCount into nField -- put tObject & labelCount into nField -- if there is no field nField then create field nField -- add 1 to labelCount -- put inputText into field nField -- set the loc of field nField to turtlePtToMousePt(xycor()) -- set the width of field nField to the formattedwidth of field nField -- set the height of field nField to the formattedHeight of field nField -- set the tool to tTool -- unLock screen --end label function mouseToTurtle pt put round(-x0 + item 1 of pt) into item 1 of temp put round( y0 - item 2 of pt) into item 2 of temp return temp end mouseToTurtle function mousePtToTurtlePt pt return mouseToTurtle(pt) end mousePtToTurtlePt function mpttp pt return mouseToTUrtle(pt) end mpttp function turtleToMouse pt put round(x0 + item 1 of pt) into item 1 of temp put round(y0 - item 2 of pt) into item 2 of temp return temp end turtleToMouse function tptmp pt return turtleToMouse(pt) end tptmp function turtlePtToMousePt pt return turtleToMouse(pt) end turtlePtToMousePt function clickPoint set the cursor to cross wait until mouseClick() --Wait for the mouse click. return mousePtToTurtlePt(mouseLoc()) --Return the mouse coordinates converted to turtle coordinates. end clickPoint on openCard global waittime --set the style of this stack to "toplevel" put 0 into waittime --clean set the grid to false put 180/ pi into degPerRad put pi/180 into radPerDeg put (the width of this card)/2 into x0 put (the height of this card)/2 into y0 choose the browse tool end openCard function sine a return sin(radPerDeg* a) end sine function cosine a return cos(radPerDeg*a) end cosine function tangent a return tan(radPerDeg*a) end tangent function arcsine a return atan(a/sqrt(1-a*a))/radPerDeg end arcsine function arcTangent a return atan(a)*degPerRad end arcTangent function arcTangent2 y,x return degPerRad*atan2(y,x) end arcTangent2 function sum list put 0 into theResult repeat with i = 1 to the paramcount add param(i) to theResult end repeat return theResult end sum on pr x set the numberformat to "#.00" if there is a field "data" then put x & return after field "data" end pr on ct put "" into field "data" end ct on functionKey tKey switch tKey case 8 if the tool is "browse tool" then choose the pointer tool else choose the browse tool end if break case 2 edit the script of this stack break case 3 edit the script of this card break case 5 go to next card break case 4 go to previous card break case 6 ct break end switch end functionKey on tell who put "graphic" && who into tObject end tell function theControls repeat with i = 1 to the number of controls put the name of control i into temp replace quote with empty in temp put temp into line i of results end repeat return results end theControls on tabKey if controlkey() = "down" then if the tool = "pointer tool" then choose browse tool else choose pointer tool else pass tabKey end tabKey ]]|e cREVGeneralscriptChecksum.tXxS! bookmarks handlerList9label clearLabel preopencard back bk centeredCircle commaFormat getTheObject fact startTurtle st intersection setHome home log cleanG clearLabels cleanT perpBisector clean incXY setxy truncItems setRA drawAndMOve setHeading drawTurtle seth left right rt lt forward fd pu penUp penDown pd toward direction direction2 xycor sci xcor ycor randomInRange setx sety distance heading mouseToTurtle mousePtToTurtlePt mpttp turtleToMouse tptmp turtlePtToMousePt clickPoint openCard sine cosine tangent arcsine arcTangent arcTangent2 sum pr ct functionKey tell theControls tabKey tempScript prevHandlerarcsinescriptSelectionchar 1365 to 1364scriptW

on label inputText,lableField

-- Lock screen

-- put the tool into tTool

-- choose the browse tool

-- set the textstyle of the templateField to "bold"

-- set the style of the templateField to "transparent"

-- set the textAlign of templateField to center

--set the dontWrap of templateField to true

--put "fieldLabel" & labelCount into nField

put LableField into tFieldName

if there is no field tFieldName then create field tFieldName

--add 1 to labelCount

put inputText into field tFieldName

put turtlePtTOMousePt(xycor()) into tLabelLoc

set the loc of field tFieldName to Item 1 of tLabelLoc,Item 2 of tLabelLoc - 10

set the width of field tFieldName to the formattedwidth of field tFieldName

set the height of field tFieldName to the formattedHeight of field tFieldName

--set the tool to tTool

--un-- Lock screen

end label

on clearLabel labelField

if there is no field labelField then create field labelField

put "" into field labelField

-- repeat with i = the number of fields down to 1

-- if labelField is in the name of field i then delete field i

-- end repeat

end clearLabel

on preopencard

-- Lock screen

set the scroll of field "instructions" to 0

set the scroll of field "data" to 0

send "mouseUP" to button "drawcurves"

--send "mouseUP" to button "slope1"

--send "mouseUP" to button "slope3"

--Lock screen

end preopencard

local angl,penDown,x,y

global radPerDeg,degPerRad,noDraw,waittime,x0,y0

local x1,y1,A1,gpoints,tObject,tGraphic,labelCount

--You may be puzzle by "drag from 0,0 to 0,0" in the handlers below, and "set the Lockscreen to true"

--Don't ask.

on back temp

forward -temp

end back

on bk temp

back temp

end bk

on centeredCircle r

put the tool into savedTool

choose the oval tool

set the centered to true

drag from round(x0+the px of tObject ),round(y0-the py of tObject) to round(x0+the px of tObject+r),round(y0-the py of tObject-r)

set the centered to false

choose the savedTool

end centeredCircle

function commaFormat pNum

put pNum mod 1 into remainder

delete char 1 of remainder

put trunc(pNum) into pNum

put the number of chars in pNum into n

repeat with i = 1 to trunc((n-1)/3)

put comma after char n - 3*i of pNum

end repeat

return pNum& remainder

end commaformat

function getTheObject who

put theControls() into tList

put "" into results

repeat for each line tLine in tList--with i = 1 to the number of lines in tList

if who is in tLine and "grc" is not in tLine then --line i of tList then

put tLine into results--line i of tList into results

exit repeat

end if

end repeat

put results into tObject

put quote before word 2 of tObject

put quote after tObject

return tObject

end getTheObject

function fact n

put 1 into results

repeat with i = 1 to n

multiply results by i

end repeat

return results

end fact

on startTurtle theObject

put round(the width of this stack/2) into x0

put round(the height of this stack/2) into y0

put "graphic" &&theObject into tObject

put 1 into labelCount

if there is no tObject then

set the style of the templateGraphic to "line"

create grc word 2 of tObject

end if

if the style of tObject is not "line" then set the style of tObject to "line"

set the px of tObject to 0

set the py of tObject to 0

set the pPenDown of tObject to true

set the pAngle of tObject to 0

set the pPoints of tObject to x0,y0 & return

end startTurtle

drawAndMove

end startTurtle

on st temp

startTurtle temp

end st

--function intersection p1,p2,pp1,pp2

-- put item 1 of p1 into x1

-- put item 2 of p1 into y1

-- put item 1 of p2 into x2

-- put item 2 of p2 into y2

-- put item 1 of pp1 into xp1

-- put item 2 of pp1 into yp1

-- put item 1 of pp2 into xp2

-- put item 2 of pp2 into yp2

-- if x1 = x2 or xp1 = xp2 then

-- if x1 = x2 then

-- return x1&comma&yp2 + (x1-xp2)*(yp2-yp1)/(xp2-xp1)

-- else

-- return xp2&comma& y2 + (xp1-x2)*(y2-y1)/(x2-x1)

-- end if

-- end if

-- put yp2 - y2 + x2*(y2-y1)/(x2 - x1) - xp2*(yp2 - yp1)/(xp2 - xp1) into numerator

-- put ((y2 - y1)/(x2 - x1) -(yp2 - yp1)/(xp2-xp1)) into denom

-- put numerator / denom into x

-- put y2 + (x-x2) *(y2-y1)/(x2-x1) into y

-- return x & comma & y

--end intersection

function intersection p1,p2,pp1,pp2

get the paramcount

if it is 1 then

put item 4 of p1 into pp2

put item 3 of p1 into pp1

put item 2 of p1 into p2

put item 1 of p1 into p1

end if

put item 1 of p1 into x1

put item 2 of p1 into y1

put item 1 of p2 into x2

put item 2 of p2 into y2

put item 1 of pp1 into xp1

put item 2 of pp1 into yp1

put item 1 of pp2 into xp2

put item 2 of pp2 into yp2

--Check if the lines are parallel and deal with it somehow

if (y2-y1)*(xp2-xp1) = (yp2-yp1)*(x2-x1) then add .0000001 to x2

if x1 = x2 or xp1 = xp2 then

if x2 = x1 then

return x1&comma&yp2 + (x1-xp2)*(yp2-yp1)/(xp2-xp1)

else

return xp2&comma& y2 + (xp1-x2)*(y2-y1)/(x2-x1)

end if

end if

put yp2 - y2 + x2*(y2-y1)/(x2 - x1) - xp2*(yp2 - yp1)/(xp2 - xp1)

into numerator

put ((y2 - y1)/(x2 - x1) -(yp2 - yp1)/(xp2-xp1)) into denom

put numerator / denom into x

put y2 + (x-x2) *(y2-y1)/(x2-x1) into y

return x & comma & y

end intersection

on setHome xx,yy

get the paramcount

if it is 1 then

put item 2 of xx into yy

put item 1 of xx into xx

end if

put (the width of this stack)/2 + xx into x0

put (the height of this stack)/2 - yy into y0

-- drawturtle

end setHome

on home

setxy 0,0

set the pAngle of tObject to 0

end home

function log x

return ln(x)/ln(10)

end log

on cleanG who

put who into temp

get the paramcount

if it is 0 then

repeat with i = 1 to the number of graphics

if "grc" is in the name of grc i then set the points of grc i to ""

end repeat

else

set the pPoints of graphic who to ""

set the points of graphic who to ""

end if

end cleanG

on clearLabels who

-- Lock screen

get the paramcount

if it is 0 then

repeat with i = the number of fields down to 1

if "label" is in the name of field i then delete field i

end repeat

end if

if it is 1 then

repeat with i = the number of fields down to 1

if "who" is in the name of field i then delete field i

end repeat

end if

-- un-- Lock screen

end clearLabels

on cleanT who

put who & "grc" into tGraphic

if there is a grc tGraphic then set the points of grc tGraphic to ""

end cleanT

function perpBisector p1,p2

breakpoint

pu

setXY p1

seth toward( p2)

fd .5*distancePt (p2)

rt 90

put point into temp1

put item 1 of temp1 into item 1 of temp

put item 2 of temp1 into item 2 of temp

put heading() into item 3 of temp

pd

return temp

end perpBisector

on clean

ct

-- Lock screen

repeat until the number of images is 0

delete image 1

end repeat

put 1 into i

repeat while i <= the number of fields

if "fieldLabel" is in word 2 of the name of field i

then delete field i

else add 1 to i

end repeat

-- un-- Lock screen

end clean

on incXY dx,dy

-- put the px of tObject into x

-- put the py of tObject into y

put the pPoints of tObject into gPoints

if the pPendown of tObject is true

then

put round (x0 +the px of tObject +dx) &comma &round(y0 -the py of tObject - dy)& return after gPoints

else

put return & round (x0 +the px of tObject +dx) &comma &round(y0 - the py of tObject - dy)& return after gPoints

end if

set the px of tObject to the px of tObject + dx

set the py of tObject to the py of tObject + dy

set the pPoints of tObject to gPoints

--set the points of grc tGraphic to gPoints

drawAndMove

end incXY

on setxy xnew,ynew

get the paramCount

if it = 1 then

put item 2 of xnew into ynew

put item 1 of xnew into xnew

end if

set the px of tObject to xnew

set the py of tObject to ynew

put the pPoints of tObject into gPoints

put round(the px of tObject +x0)&comma& round(y0 - the py of tObject) into tLoc

if the pPendown of tObject is true then

--put truncItems(tLoc) into tLoc

put tLoc & return after gPoints

else

put return & tloc & return after gPoints

end if

set the pPoints of tObject to gPoints

DrawAndMove

--set the lockscreen to false

end setxy

function truncItems tItem

return round(item 1 of tItem)& comma&round(item 2 of tItem)

end truncItems

on setRA tRadius, tAngle

put tRadius*cosine(tAngle) into tx

put tRadius*sine(tAngle) into ty

setXY tX,tY

end setRA

on drawAndMOve

set the points of tObject to the pPoints of tObject

--wait 0 millisec

--set the points of graphic tGraphic to the pPoints of tObject

--set the loc of tObject to round(x0 +the px of tObject)&comma&round(y0-the py of tObject)

end drawAndMOve

on setHeading temp

seth temp

end setHeading

on drawTurtle

end drawTurtle

on seth anglnew

set the pAngle of tObject to anglnew

--drawTurtle

end seth

on left dangl

lt dangl

end left

on right dangl

rt dangl

end right

on rt dangl

set the pAngle of tObject to the pAngle of tObject - dangl

--drawTurtle

end rt

on lt dangl

set the pAngle of tObject to the pAngle of tObject + dangl

end lt

on forward distance

put distance * cos(radPerDeg * the pAngle of tObject) into dx

put distance * sin(radPerDeg * the pAngle of tObject) into dy

set the px of tObject to the px of tObject + dx

set the py of tObject to the py of tObject + dy

put the pPoints of tObject into gPoints

put round(the px of tObject +x0)&comma&round(y0- the py of tObject) into tMouseLoc

if the pPenDown of tObject is true then

put tMouseLoc &return after gPoints

else

put return & round(the px of tObject+x0)&comma&round(-the py of tObject+y0)& return after gPoints

end if

set the points of tObject to gPoints

set the pPoints of tObject to gPoints

--set the loc of tObject to tMouseLoc

end forward

on fd temp

forward temp

end fd

on pu

set the pPenDown of tObject to false

end pu

on penUp

pu

end penUp

on penDown

pd

end penDown

on pd

set the pPendown of tObject to true

end pd

function toward xtemp,ytemp

get the paramCount

if it is 1 then

put item 2 of xtemp into ytemp

put item 1 of xtemp into xtemp

end if

put ytemp - y into dy

put xtemp - x into dx

if dx = 0 then

if dy > 0 then return 90

else return 90 + 180

end if

if dy = 0 then

if dx > 0 then return 0

else return 180

end if

put degPerRad * atan(abs(dy) / abs(dx)) into angl

if dy > 0 then

if dx > 0 then return angl

else return 180 - angl

end if

if dx > 0 then

return 360 - angl

else

return 180 + angl

end if

end toward

function direction xtemp,ytemp

put the px of tObject into x

put the py of tObject into y

get the paramCount

if it is 1 then

put item 2 of xtemp into ytemp

put item 1 of xtemp into xtemp

end if

put ytemp - y into dy

put xtemp - x into dx

if dx = 0 then

if dy > 0 then return 90

else return 90 + 180

end if

if dy = 0 then

if dx > 0 then return 0

else return 180

end if

put degPerRad * atan(abs(dy) / abs(dx)) into tAngl

if dy > 0 then

if dx > 0 then return tAngl

else return 180 - tAngl

end if

if dx > 0 then

return 360 - tAngl

else

return 180 + tAngl

end if

end direction

function direction2 xtemp,ytemp

get the paramCount

if it is 1 then

put item 2 of xtemp into ytemp

put item 1 of xtemp into xtemp

end if

put ytemp - y into dy

put xtemp - x into dx

put arctangent2(dy,dx) into tAngle

if tAngle < 0 then return 360 + tAngle

else return tAngle

end direction2

function xycor

return (the px of tObject) & comma & (the py of tObject)

end xycor

function sci pNum,sigFigures

if pNum < 0 then

put "-" into sign

else put empty into sign

put abs(pNum) into pNum

if sigFigures is empty then put 3 into sigFigures --Default significant figures.

put 0 into count

if pNum >= 1 then

repeat until pNum < 10

divide pNum by 10

add 1 to count

end repeat

put round((10^(sigFigures-1))*pNum)/10^(sigFigures-1) into pNum

return sign & (char 1 to sigFigures + 1 of pNum) &"*10^" & count

end if

if pNum < 1 then

repeat until pNum >= 1

multiply pNum by 10

add 1 to count

end repeat

end if

return sign & (char 1 to sigFigures + 1 of pNum) & "*10^-" & count

end sci

function xcor

return the px of tObject

end xcor

function ycor

return the py of tObject

end ycor

function randomInRange b,t

return random(t-b+1) + b-1

end randomInRange

on setx xnew

setxy xnew, the py of tObject

end setx

on sety ynew

setxy the px of tObject, ynew

end sety

function distance xtemp,ytemp

get the paramCount

if it = 1 then

put item 2 of xtemp into ytemp

put item 1 of xtemp into xtemp

end if

return sqrt ((the px of tObject -xtemp)^2 + (the py of tObject-ytemp)^2)

end distance

function heading

put the pAngle of tObject into tempAngle

--set the pAngle of tObject to the pAngle of tObject - dangl

repeat while tempAngle >360

subtract 360 from tempAngle

end repeat

repeat while tempAngle < 0

add 360 to tempAngle

end repeat

return tempAngle

end heading

--on label inputText

-- -- Lock screen

-- put the tool into tTool

-- choose the browse tool

-- set the textstyle of the templateField to "bold"

-- set the style of the templateField to "transparent"

-- set the textAlign of templateField to center

-- --set the dontWrap of templateField to true

-- --put "fieldLabel" & labelCount into nField

-- put tObject & labelCount into nField

-- if there is no field nField then create field nField

-- add 1 to labelCount

-- put inputText into field nField

-- set the loc of field nField to turtlePtToMousePt(xycor())

-- set the width of field nField to the formattedwidth of field nField

-- set the height of field nField to the formattedHeight of field nField

-- set the tool to tTool

-- un-- Lock screen

--end label

function mouseToTurtle pt

put round(-x0 + item 1 of pt) into item 1 of temp

put round( y0 - item 2 of pt) into item 2 of temp

return temp

end mouseToTurtle

function mousePtToTurtlePt pt

return mouseToTurtle(pt)

end mousePtToTurtlePt

function mpttp pt

return mouseToTUrtle(pt)

end mpttp

function turtleToMouse pt

put round(x0 + item 1 of pt) into item 1 of temp

put round(y0 - item 2 of pt) into item 2 of temp

return temp

end turtleToMouse

function tptmp pt

return turtleToMouse(pt)

end tptmp

function turtlePtToMousePt pt

return turtleToMouse(pt)

end turtlePtToMousePt

function clickPoint

set the cursor to cross

wait until mouseClick() --Wait for the mouse click.

return mousePtToTurtlePt(mouseLoc()) --Return the mouse coordinates converted to turtle coordinates.

end clickPoint

on openCard

global waittime

--set the style of this stack to "toplevel"

put 0 into waittime

--clean

set the grid to false

put 180/ pi into degPerRad

put pi/180 into radPerDeg

put (the width of this card)/2 into x0

put (the height of this card)/2 into y0

choose the browse tool

end openCard

function sine a

return sin(radPerDeg* a)

end sine

function cosine a

return cos(radPerDeg*a)

end cosine

function tangent a

return tan(radPerDeg*a)

end tangent

function arcsine a

return atan(a/sqrt(1-a*a))/radPerDeg

end arcsine

function arcTangent a

return atan(a)*degPerRad

end arcTangent

function arcTangent2 y,x

return degPerRad*atan2(y,x)

end arcTangent2

function sum list

put 0 into theResult

repeat with i = 1 to the paramcount

add param(i) to theResult

end repeat

return theResult

end sum

on pr x

set the numberformat to "#.00"

if there is a field "data" then put x & return after field "data"

end pr

on ct

put "" into field "data"

end ct

on functionKey tKey

switch tKey

case 8

if the tool is "browse tool" then

choose the pointer tool

else

choose the browse tool

end if

break

case 2

edit the script of this stack

break

case 3

edit the script of this card

break

case 5

go to next card

break

case 4

go to previous card

break

case 6

ct

break

end switch

end functionKey

on tell who

put "graphic" && who into tObject

end tell

function theControls

repeat with i = 1 to the number of controls

put the name of control i into temp

replace quote with empty in temp

put temp into line i of results

end repeat

return results

end theControls

on tabKey

if controlkey() = "down" then

if the tool = "pointer tool"

then choose browse tool

else choose pointer tool

else pass tabKey

end tabKey

"#$%'()*+,-./013456789:89 S     P9local angl,penDown,x,y global radPerDeg,degPerRad,noDraw,waittime,x0,y0 local x1,y1,A1,gpoints,tObject,tGraphic,labelCount on drawAndMOve set the points of graphic tGraphic to the pPoints of tObject --gPoints -- set the pPoints of tObject to gPoints set the loc of tObject to round(x0 +the px of tObject)&comma&round(y0-the py of tObject) Wait 0 millisec end drawAndMOve on back temp forward -temp end back on bk temp back temp end bk on centeredCircle r put the tool into savedTool choose the oval tool set the centered to true drag from round(x0+the px of tObject ),round(y0-the py of tObject) to round(x0+the px of tObject+r),round(y0-the py of tObject-r) set the centered to false choose the savedTool end centeredCircle function commaFormat pNum put pNum mod 1 into remainder delete char 1 of remainder put trunc(pNum) into pNum put the number of chars in pNum into n repeat with i = 1 to trunc((n-1)/3) put comma after char n - 3*i of pNum end repeat return pNum& remainder end commaformat function getTheObject who put theControls() into tList put "" into results repeat for each line tLine in tList--with i = 1 to the number of lines in tList if who is in tLine then --line i of tList then put tLine into results--line i of tList into results exit repeat end if end repeat put results into tObject put quote before word 2 of tObject put quote after tObject return tObject end getTheObject function fact n put 1 into results repeat with i = 1 to n multiply results by i end repeat return results end fact on startTurtle temp put round(the width of this stack/2) into x0 put round(the height of this stack/2) into y0 -- ask "Who to tell?" with "Turtle" put getTheObject(temp) into tObject put 1 into i repeat while i <= the number of fields if "fieldLabel" is in the name of field i then delete field i else add 1 to i end repeat if not exists(tObject) then answer "There is no such object." exit to top end if put 0 into labelCount put word 2 of tObject & "grc" into tGraphic replace quote with "" in tGraphic if there is no grc tGraphic then set the style of the templateGraphic to "line" create grc tGraphic end if set the px of tObject to 0 set the py of tObject to 0 set the pPenDown of tObject to true set the pAngle of tObject to 0 set the pPoints of tObject to x0,y0 & return drawAndMove end startTurtle on st temp startTurtle temp end st function intersection p1,p2,pp1,pp2 put item 1 of p1 into x1 put item 2 of p1 into y1 put item 1 of p2 into x2 put item 2 of p2 into y2 put item 1 of pp1 into xp1 put item 2 of pp1 into yp1 put item 1 of pp2 into xp2 put item 2 of pp2 into yp2 if x1 = x2 or xp1 = xp2 then if x1 = x2 then return x1&comma&yp2 + (x1-xp2)*(yp2-yp1)/(xp2-xp1) else return xp2&comma& y2 + (xp1-x2)*(y2-y1)/(x2-x1) end if end if put yp2 - y2 + x2*(y2-y1)/(x2 - x1) - xp2*(yp2 - yp1)/(xp2 - xp1) into numerator put ((y2 - y1)/(x2 - x1) -(yp2 - yp1)/(xp2-xp1)) into denom put numerator / denom into x put y2 + (x-x2) *(y2-y1)/(x2-x1) into y return x & comma & y end intersection on setHome xx,yy put (the width of this stack)/2 + xx into x0 put (the height of this stack)/2 - yy into y0 -- drawturtle end setHome on home setxy 0,0 set the pAngle of tObject to 0 end home function log x return ln(x)/ln(10) end log on cleanG who put who into temp get the paramcount if it is 0 then repeat with i = 1 to the number of graphics if "grc" is in the name of grc i then set the points of grc i to "" end repeat else set the pPoints of graphic who to "" put the points of grc who to "" end if end cleanG on cleanT who put who & "grc" into tGraphic if there is a grc tGraphic then set the points of grc tGraphic to "" end cleanT function perpBisector p1,p2 breakpoint pu setXY p1 seth toward( p2) fd .5*distancePt (p2) rt 90 put point into temp1 put item 1 of temp1 into item 1 of temp put item 2 of temp1 into item 2 of temp put heading() into item 3 of temp pd return temp end perpBisector on clean ct lock screen repeat until the number of images is 0 delete image 1 end repeat put 1 into i repeat while i <= the number of fields if "fieldLabel" is in word 2 of the name of field i then delete field i else add 1 to i end repeat unlock screen end clean on incXY dx,dy -- put the px of tObject into x -- put the py of tObject into y put the pPoints of tObject into gPoints if the pPendown of tObject is true then put round (x0 +the px of tObject +dx) &comma &round(y0 -the py of tObject - dy)& return after gPoints else put return & round (x0 +the px of tObject +dx) &comma &round(y0 - the py of tObject - dy)& return after gPoints end if set the px of tObject to the px of tObject + dx set the py of tObject to the py of tObject + dy set the pPoints of tObject to gPoints --set the points of grc tGraphic to gPoints drawAndMove end incXY on setxy xnew,ynew get the paramCount if it = 1 then put item 2 of xnew into ynew put item 1 of xnew into xnew end if set the px of tObject to xnew set the py of tObject to ynew put the pPoints of tObject into gPoints if the pPendown of tObject is true then put round(the px of tObject +x0)&comma&round(y0 - the py of tObject)& return after gPoints else put return & round(the px of tObject +x0)&comma&round(y0 - the py of tObject)& return after gPoints end if set the pPoints of tObject to gPoints DrawAndMove --set the lockscreen to false end setxy on setRA tRadius, tAngle put tRadius*cosine(tAngle) into tx put tRadius*sine(tAngle) into ty setXY tX,tY end setRA on drawAndMOve set the points of graphic tGraphic to the pPoints of tObject --gPoints -- set the pPoints of tObject to gPoints set the loc of tObject to round(x0 +the px of tObject)&comma&round(y0-the py of tObject) Wait 0 millisec end drawAndMOve on setHeading temp seth temp end setHeading on drawTurtle end drawTurtle on seth anglnew set the pAngle of tObject to anglnew --drawTurtle end seth on left dangl lt dangl end left on right dangl rt dangl end right on rt dangl set the pAngle of tObject to the pAngle of tObject - dangl --drawTurtle end rt on lt dangl set the pAngle of tObject to the pAngle of tObject + dangl end lt --on forward distance -- put distance * cos(radPerDeg * the pAngle of tObject) into dx -- put distance * sin(radPerDeg * the pAngle of tObject) into dy -- set the px of tObject to the px of tObject + dx -- set the py of tObject to the py of tObject + dy -- put the pPoints of tObject into gPoints -- if the pPenDown of tObject is true then -- put round(the px of tObject +x0)&comma&round(y0- the py of tObject)& return after gPoints -- else -- put return & round(x+x0)&comma&round(-y+y0)& return after gPoints -- end if -- set the points of graphic tGraphic to gPoints -- set the pPoints of tObject to gPoints -- set the loc of tObject to round(x0 +the px of tObject)&comma&round(y0-the py of tObject) --end forward on forward distance put distance * cos(radPerDeg * the pAngle of tObject) into dx put distance * sin(radPerDeg * the pAngle of tObject) into dy set the px of tObject to the px of tObject + dx set the py of tObject to the py of tObject + dy put the pPoints of tObject into gPoints put round(the px of tObject +x0)&comma&round(y0- the py of tObject) into tMouseLoc if the pPenDown of tObject is true then put tMouseLoc &return after gPoints else put return & round(x+x0)&comma&round(-y+y0)& return after gPoints end if set the points of graphic tGraphic to gPoints set the pPoints of tObject to gPoints set the loc of tObject to tMouseLoc end forward on fd temp forward temp end fd on pu set the pPenDown of tObject to false end pu on penUp pu end penUp on penDown pd end penDown on pd set the pPendown of tObject to true end pd function toward xtemp,ytemp get the paramCount if it is 1 then put item 2 of xtemp into ytemp put item 1 of xtemp into xtemp end if put ytemp - y into dy put xtemp - x into dx if dx = 0 then if dy > 0 then return 90 else return 90 + 180 end if if dy = 0 then if dx > 0 then return 0 else return 180 end if put degPerRad * atan(abs(dy) / abs(dx)) into angl if dy > 0 then if dx > 0 then return angl else return 180 - angl end if if dx > 0 then return 360 - angl else return 180 + angl end if end toward function direction xtemp,ytemp put the px of tObject into x put the py of tObject into y get the paramCount if it is 1 then put item 2 of xtemp into ytemp put item 1 of xtemp into xtemp end if put ytemp - y into dy put xtemp - x into dx if dx = 0 then if dy > 0 then return 90 else return 90 + 180 end if if dy = 0 then if dx > 0 then return 0 else return 180 end if put degPerRad * atan(abs(dy) / abs(dx)) into tAngl if dy > 0 then if dx > 0 then return tAngl else return 180 - tAngl end if if dx > 0 then return 360 - tAngl else return 180 + tAngl end if end direction function direction2 xtemp,ytemp get the paramCount if it is 1 then put item 2 of xtemp into ytemp put item 1 of xtemp into xtemp end if put ytemp - y into dy put xtemp - x into dx put arctangent2(dy,dx) into tAngle if tAngle < 0 then return 360 + tAngle else return tAngle end direction2 function xycor return the px of tObject & comma & the py of tObject end xycor function sci pNum,sigFigures if pNum < 0 then put "-" into sign else put empty into sign put abs(pNum) into pNum if sigFigures is empty then put 3 into sigFigures --Default significant figures. put 0 into count if pNum >= 1 then repeat until pNum < 10 divide pNum by 10 add 1 to count end repeat put round((10^(sigFigures-1))*pNum)/10^(sigFigures-1) into pNum return sign & (char 1 to sigFigures + 1 of pNum) &"*10^" & count end if if pNum < 1 then repeat until pNum >= 1 multiply pNum by 10 add 1 to count end repeat end if return sign & (char 1 to sigFigures + 1 of pNum) & "*10^-" & count end sci function xcor return the px of tObject end xcor function ycor return the py of tObject end ycor function randomInRange b,t return random(t-b+1) + b-1 end randomInRange on setx xnew setxy xnew, the py of tObject end setx on sety ynew setxy the px of tObject, ynew end sety function distance xtemp,ytemp get the paramCount if it = 1 then put item 2 of xtemp into ytemp put item 1 of xtemp into xtemp end if return sqrt ((the px of tObject -xtemp)^2 + (the py of tObject-ytemp)^2) end distance function heading repeat while angl >360 subtract 360 from angl end repeat repeat while angl < 0 add 360 to angl end repeat return angl end heading on label inputText lock screen put the tool into tTool choose the browse tool set the textstyle of the templateField to "bold" set the style of the templateField to "transparent" set the textAlign of templateField to center --set the dontWrap of templateField to true put "fieldLabel" & labelCount into nField create field nField add 1 to labelCount put inputText into field nField set the loc of field nField to turtlePtToMousePt(xycor()) set the width of field nField to the formattedwidth of field nField set the height of field nField to the formattedHeight of field nField set the tool to tTool unlock screen end label function mouseToTurtle pt put round(-x0 + item 1 of pt) into item 1 of temp put round( y0 - item 2 of pt) into item 2 of temp return temp end mouseToTurtle function mousePtToTurtlePt pt return mouseToTurtle(pt) end mousePtToTurtlePt function turtleToMouse pt put round(x0 + item 1 of pt) into item 1 of temp put round(y0 - item 2 of pt) into item 2 of temp return temp end turtleToMouse function turtlePtToMousePt pt return turtleToMouse(pt) end turtlePtToMousePt function clickPoint set the cursor to cross wait until mouseClick() --Wait for the mouse click. return mousePtToTurtlePt(mouseLoc()) --Return the mouse coordinates converted to turtle coordinates. end clickPoint on preopenStack global waittime --set the style of this stack to "toplevel" put 0 into waittime --clean set the grid to false put 180/ pi into degPerRad put pi/180 into radPerDeg put (the width of this card)/2 into x0 put (the height of this card)/2 into y0 choose the browse tool end preopenStack function sine a return sin(radPerDeg* a) end sine function cosine a return cos(radPerDeg*a) end cosine function tangent a return tan(radPerDeg*a) end tangent function arcsine a return atan(a/sqrt(1-a*a))/radPerDeg end arcsine function arcTangent a return atan(a)*degPerRad end arcTangent function arcTangent2 y,x return degPerRad*atan2(y,x) end arcTangent2 function sum list put 0 into theResult repeat with i = 1 to the paramcount add param(i) to theResult end repeat return theResult end sum on pr x set the numberformat to "#.00" if there is a field "data" then put x & return after field "data" end pr on functionKey tKey switch tKey case 8 if the tool is "browse tool" then choose the pointer tool else choose the browse tool end if break case 2 edit the script of this stack break case 3 edit the script of this card break case 5 go to next card break case 4 go to previous card break case 6 ct break end switch end functionKey on tell who put getTheObject(who) into tObject put word 2 of tObject &"grc" into tGraphic replace quote with "" in tGraphic -- put the px of tObject into x -- put the py of tObject into y -- put the pPenDown of tObject into pendown -- put the pAngle of tObject into angl -- put the pPoints of tObject into gpoints end tell function theControls repeat with i = 1 to the number of controls put the name of control i into temp replace quote with empty in temp put temp into line i of results end repeat return results end theControls on tabKey if controlkey() = "down" then if the tool = "pointer tool" then choose browse tool else choose pointer tool else pass tabKey end tabKey ]]|estopMefalsepower2 cREVGeneralscriptChecksumMޭSjYQ bookmarks handlerList drawAndMOve back bk centeredCircle commaFormat getTheObject fact startTurtle st intersection setHome home log cleanG cleanT perpBisector clean incXY setxy setRA drawAndMOve setHeading drawTurtle seth left right rt lt forward fd pu penUp penDown pd toward direction direction2 xycor sci xcor ycor randomInRange setx sety distance heading label mouseToTurtle mousePtToTurtlePt turtleToMouse turtlePtToMousePt clickPoint preopenStack sine cosine tangent arcsine arcTangent arcTangent2 sum pr functionKey tell theControls tabKey tempScript prevHandler drawAndMOvescriptSelectionchar 347 to 361scriptMo

local angl,penDown,x,y

global radPerDeg,degPerRad,noDraw,waittime,x0,y0

local x1,y1,A1,gpoints,tObject,tGraphic,labelCount

on drawAndMOve

set the points of graphic tGraphic to the pPoints of tObject --gPoints

-- set the pPoints of tObject to gPoints

set the loc of tObject to round(x0 +the px of tObject)&comma&round(y0-the py of tObject)

wait 0 millisec

end drawAndMOve

on back temp

forward -temp

end back

on bk temp

back temp

end bk

on centeredCircle r

put the tool into savedTool

choose the oval tool

set the centered to true

drag from round(x0+the px of tObject ),round(y0-the py of tObject) to round(x0+the px of tObject+r),round(y0-the py of tObject-r)

set the centered to false

choose the savedTool

end centeredCircle

function commaFormat pNum

put pNum mod 1 into remainder

delete char 1 of remainder

put trunc(pNum) into pNum

put the number of chars in pNum into n

repeat with i = 1 to trunc((n-1)/3)

put comma after char n - 3*i of pNum

end repeat

return pNum& remainder

end commaformat

function getTheObject who

put theControls() into tList

put "" into results

repeat for each line tLine in tList--with i = 1 to the number of lines in tList

if who is in tLine then --line i of tList then

put tLine into results--line i of tList into results

exit repeat

end if

end repeat

put results into tObject

put quote before word 2 of tObject

put quote after tObject

return tObject

end getTheObject

function fact n

put 1 into results

repeat with i = 1 to n

multiply results by i

end repeat

return results

end fact

on startTurtle temp

put round(the width of this stack/2) into x0

put round(the height of this stack/2) into y0

-- ask "Who to tell?" with "Turtle"

put getTheObject(temp) into tObject

put 1 into i

repeat while i <= the number of fields

if "fieldLabel" is in the name of field i

then delete field i

else add 1 to i

end repeat

if not exists(tObject) then

answer "There is no such object."

exit to top

end if

put 0 into labelCount

put word 2 of tObject & "grc" into tGraphic

replace quote with "" in tGraphic

if there is no grc tGraphic then

set the style of the templateGraphic to "line"

create grc tGraphic

end if

set the px of tObject to 0

set the py of tObject to 0

set the pPenDown of tObject to true

set the pAngle of tObject to 0

set the pPoints of tObject to x0,y0 & return

drawAndMove

end startTurtle

on st temp

startTurtle temp

end st

function intersection p1,p2,pp1,pp2

put item 1 of p1 into x1

put item 2 of p1 into y1

put item 1 of p2 into x2

put item 2 of p2 into y2

put item 1 of pp1 into xp1

put item 2 of pp1 into yp1

put item 1 of pp2 into xp2

put item 2 of pp2 into yp2

if x1 = x2 or xp1 = xp2 then

if x1 = x2 then

return x1&comma&yp2 + (x1-xp2)*(yp2-yp1)/(xp2-xp1)

else

return xp2&comma& y2 + (xp1-x2)*(y2-y1)/(x2-x1)

end if

end if

put yp2 - y2 + x2*(y2-y1)/(x2 - x1) - xp2*(yp2 - yp1)/(xp2 - xp1) into numerator

put ((y2 - y1)/(x2 - x1) -(yp2 - yp1)/(xp2-xp1)) into denom

put numerator / denom into x

put y2 + (x-x2) *(y2-y1)/(x2-x1) into y

return x & comma & y

end intersection

on setHome xx,yy

put (the width of this stack)/2 + xx into x0

put (the height of this stack)/2 - yy into y0

-- drawturtle

end setHome

on home

setxy 0,0

set the pAngle of tObject to 0

end home

function log x

return ln(x)/ln(10)

end log

on cleanG who

put who into temp

get the paramcount

if it is 0 then

repeat with i = 1 to the number of graphics

if "grc" is in the name of grc i then set the points of grc i to ""

end repeat

else

set the pPoints of graphic who to ""

put the points of grc who to ""

end if

end cleanG

on cleanT who

put who & "grc" into tGraphic

if there is a grc tGraphic then set the points of grc tGraphic to ""

end cleanT

function perpBisector p1,p2

breakpoint

pu

setXY p1

seth toward( p2)

fd .5*distancePt (p2)

rt 90

put point into temp1

put item 1 of temp1 into item 1 of temp

put item 2 of temp1 into item 2 of temp

put heading() into item 3 of temp

pd

return temp

end perpBisector

on clean

ct

lock screen

repeat until the number of images is 0

delete image 1

end repeat

put 1 into i

repeat while i <= the number of fields

if "fieldLabel" is in word 2 of the name of field i

then delete field i

else add 1 to i

end repeat

unlock screen

end clean

on incXY dx,dy

-- put the px of tObject into x

-- put the py of tObject into y

put the pPoints of tObject into gPoints

if the pPendown of tObject is true

then

put round (x0 +the px of tObject +dx) &comma &round(y0 -the py of tObject - dy)& return after gPoints

else

put return & round (x0 +the px of tObject +dx) &comma &round(y0 - the py of tObject - dy)& return after gPoints

end if

set the px of tObject to the px of tObject + dx

set the py of tObject to the py of tObject + dy

set the pPoints of tObject to gPoints

--set the points of grc tGraphic to gPoints

drawAndMove

end incXY

on setxy xnew,ynew

get the paramCount

if it = 1 then

put item 2 of xnew into ynew

put item 1 of xnew into xnew

end if

set the px of tObject to xnew

set the py of tObject to ynew

put the pPoints of tObject into gPoints

if the pPendown of tObject is true

then

put round(the px of tObject +x0)&comma&round(y0 - the py of tObject)& return after gPoints

else

put return & round(the px of tObject +x0)&comma&round(y0 - the py of tObject)& return after gPoints

end if

set the pPoints of tObject to gPoints

DrawAndMove

--set the lockscreen to false

end setxy

on setRA tRadius, tAngle

put tRadius*cosine(tAngle) into tx

put tRadius*sine(tAngle) into ty

setXY tX,tY

end setRA

on drawAndMOve

set the points of graphic tGraphic to the pPoints of tObject --gPoints

-- set the pPoints of tObject to gPoints

set the loc of tObject to round(x0 +the px of tObject)&comma&round(y0-the py of tObject)

wait 0 millisec

end drawAndMOve

on setHeading temp

seth temp

end setHeading

on drawTurtle

end drawTurtle

on seth anglnew

set the pAngle of tObject to anglnew

--drawTurtle

end seth

on left dangl

lt dangl

end left

on right dangl

rt dangl

end right

on rt dangl

set the pAngle of tObject to the pAngle of tObject - dangl

--drawTurtle

end rt

on lt dangl

set the pAngle of tObject to the pAngle of tObject + dangl

end lt

--on forward distance

-- put distance * cos(radPerDeg * the pAngle of tObject) into dx

-- put distance * sin(radPerDeg * the pAngle of tObject) into dy

-- set the px of tObject to the px of tObject + dx

-- set the py of tObject to the py of tObject + dy

-- put the pPoints of tObject into gPoints

-- if the pPenDown of tObject is true then

-- put round(the px of tObject +x0)&comma&round(y0- the py of tObject)& return after gPoints

-- else

-- put return & round(x+x0)&comma&round(-y+y0)& return after gPoints

-- end if

-- set the points of graphic tGraphic to gPoints

-- set the pPoints of tObject to gPoints

-- set the loc of tObject to round(x0 +the px of tObject)&comma&round(y0-the py of tObject)

--end forward

on forward distance

put distance * cos(radPerDeg * the pAngle of tObject) into dx

put distance * sin(radPerDeg * the pAngle of tObject) into dy

set the px of tObject to the px of tObject + dx

set the py of tObject to the py of tObject + dy

put the pPoints of tObject into gPoints

put round(the px of tObject +x0)&comma&round(y0- the py of tObject) into tMouseLoc

if the pPenDown of tObject is true then

put tMouseLoc &return after gPoints

else

put return & round(x+x0)&comma&round(-y+y0)& return after gPoints

end if

set the points of graphic tGraphic to gPoints

set the pPoints of tObject to gPoints

set the loc of tObject to tMouseLoc

end forward

on fd temp

forward temp

end fd

on pu

set the pPenDown of tObject to false

end pu

on penUp

pu

end penUp

on penDown

pd

end penDown

on pd

set the pPendown of tObject to true

end pd

function toward xtemp,ytemp

get the paramCount

if it is 1 then

put item 2 of xtemp into ytemp

put item 1 of xtemp into xtemp

end if

put ytemp - y into dy

put xtemp - x into dx

if dx = 0 then

if dy > 0 then return 90

else return 90 + 180

end if

if dy = 0 then

if dx > 0 then return 0

else return 180

end if

put degPerRad * atan(abs(dy) / abs(dx)) into angl

if dy > 0 then

if dx > 0 then return angl

else return 180 - angl

end if

if dx > 0 then

return 360 - angl

else

return 180 + angl

end if

end toward

function direction xtemp,ytemp

put the px of tObject into x

put the py of tObject into y

get the paramCount

if it is 1 then

put item 2 of xtemp into ytemp

put item 1 of xtemp into xtemp

end if

put ytemp - y into dy

put xtemp - x into dx

if dx = 0 then

if dy > 0 then return 90

else return 90 + 180

end if

if dy = 0 then

if dx > 0 then return 0

else return 180

end if

put degPerRad * atan(abs(dy) / abs(dx)) into tAngl

if dy > 0 then

if dx > 0 then return tAngl

else return 180 - tAngl

end if

if dx > 0 then

return 360 - tAngl

else

return 180 + tAngl

end if

end direction

function direction2 xtemp,ytemp

get the paramCount

if it is 1 then

put item 2 of xtemp into ytemp

put item 1 of xtemp into xtemp

end if

put ytemp - y into dy

put xtemp - x into dx

put arctangent2(dy,dx) into tAngle

if tAngle < 0 then return 360 + tAngle

else return tAngle

end direction2

function xycor

return the px of tObject & comma & the py of tObject

end xycor

function sci pNum,sigFigures

if pNum < 0 then

put "-" into sign

else put empty into sign

put abs(pNum) into pNum

if sigFigures is empty then put 3 into sigFigures --Default significant figures.

put 0 into count

if pNum >= 1 then

repeat until pNum < 10

divide pNum by 10

add 1 to count

end repeat

put round((10^(sigFigures-1))*pNum)/10^(sigFigures-1) into pNum

return sign & (char 1 to sigFigures + 1 of pNum) &"*10^" & count

end if

if pNum < 1 then

repeat until pNum >= 1

multiply pNum by 10

add 1 to count

end repeat

end if

return sign & (char 1 to sigFigures + 1 of pNum) & "*10^-" & count

end sci

function xcor

return the px of tObject

end xcor

function ycor

return the py of tObject

end ycor

function randomInRange b,t

return random(t-b+1) + b-1

end randomInRange

on setx xnew

setxy xnew, the py of tObject

end setx

on sety ynew

setxy the px of tObject, ynew

end sety

function distance xtemp,ytemp

get the paramCount

if it = 1 then

put item 2 of xtemp into ytemp

put item 1 of xtemp into xtemp

end if

return sqrt ((the px of tObject -xtemp)^2 + (the py of tObject-ytemp)^2)

end distance

function heading

repeat while angl >360

subtract 360 from angl

end repeat

repeat while angl < 0

add 360 to angl

end repeat

return angl

end heading

on label inputText

lock screen

put the tool into tTool

choose the browse tool

set the textstyle of the templateField to "bold"

set the style of the templateField to "transparent"

set the textAlign of templateField to center

--set the dontWrap of templateField to true

put "fieldLabel" & labelCount into nField

create field nField

add 1 to labelCount

put inputText into field nField

set the loc of field nField to turtlePtToMousePt(xycor())

set the width of field nField to the formattedwidth of field nField

set the height of field nField to the formattedHeight of field nField

set the tool to tTool

unlock screen

end label

function mouseToTurtle pt

put round(-x0 + item 1 of pt) into item 1 of temp

put round( y0 - item 2 of pt) into item 2 of temp

return temp

end mouseToTurtle

function mousePtToTurtlePt pt

return mouseToTurtle(pt)

end mousePtToTurtlePt

function turtleToMouse pt

put round(x0 + item 1 of pt) into item 1 of temp

put round(y0 - item 2 of pt) into item 2 of temp

return temp

end turtleToMouse

function turtlePtToMousePt pt

return turtleToMouse(pt)

end turtlePtToMousePt

function clickPoint

set the cursor to cross

wait until mouseClick() --Wait for the mouse click.

return mousePtToTurtlePt(mouseLoc()) --Return the mouse coordinates converted to turtle coordinates.

end clickPoint

on preopenStack

global waittime

--set the style of this stack to "toplevel"

put 0 into waittime

--clean

set the grid to false

put 180/ pi into degPerRad

put pi/180 into radPerDeg

put (the width of this card)/2 into x0

put (the height of this card)/2 into y0

choose the browse tool

end preopenStack

function sine a

return sin(radPerDeg* a)

end sine

function cosine a

return cos(radPerDeg*a)

end cosine

function tangent a

return tan(radPerDeg*a)

end tangent

function arcsine a

return atan(a/sqrt(1-a*a))/radPerDeg

end arcsine

function arcTangent a

return atan(a)*degPerRad

end arcTangent

function arcTangent2 y,x

return degPerRad*atan2(y,x)

end arcTangent2

function sum list

put 0 into theResult

repeat with i = 1 to the paramcount

add param(i) to theResult

end repeat

return theResult

end sum

on pr x

set the numberformat to "#.00"

if there is a field "data" then put x & return after field "data"

end pr

on functionKey tKey

switch tKey

case 8

if the tool is "browse tool" then

choose the pointer tool

else

choose the browse tool

end if

break

case 2

edit the script of this stack

break

case 3

edit the script of this card

break

case 5

go to next card

break

case 4

go to previous card

break

case 6

ct

break

end switch

end functionKey

on tell who

put getTheObject(who) into tObject

put word 2 of tObject &"grc" into tGraphic

replace quote with "" in tGraphic

-- put the px of tObject into x

-- put the py of tObject into y

-- put the pPenDown of tObject into pendown

-- put the pAngle of tObject into angl

-- put the pPoints of tObject into gpoints

end tell

function theControls

repeat with i = 1 to the number of controls

put the name of control i into temp

replace quote with empty in temp

put temp into line i of results

end repeat

return results

end theControls

on tabKey

if controlkey() = "down" then

if the tool = "pointer tool"

then choose browse tool

else choose pointer tool

else pass tabKey

end tabKey

Z Q S X Y   MountainKBJJblackUUUUUUuE!wvw cREVGeneral revUniqueID 1075472614741EarthKD// (,,px0py0 pPenDowntruepPoints455,319 pAngle0h cREVGeneral revUniqueID 1075472614743 Canon.png  @PH+px0py206 pPenDownfalsepPoints446,307 446,101 pAngle0PNG  IHDREkgAMAOX2tEXtSoftwareAdobe ImageReadyqe<PLTE=AE魭ʱtuuDIMަDFJ369ڍԕqqrIMQmnpQVZ’ iij59<`aaRX\eehllm\\]RW[~~def|}~VWY:;A,.0PTX]^_ĝzz}ghjOPRoprJLN68:!"$~557035 |vr%'(MRV&(+DDFabdNNPLPT{|}246)*,()+QW[wxy stv,-/),._`aNRVHIK?@BXYZϜYZ\ !#$%'JPT"$&rstNSXBCE==?01289;IFCGKOZ[]SSVkloPVY_YU ;<=NTWOTXOUYOTYPUYNTXKPS؊LQUݫѮԤbcdgc`徾ܑLRUsnj=97?=;OTZ7;?ea_LJ?DGNSWj9otRNSO4 IDATxb3@1 6Рs@ :Рs@ :Рs@ :Рs@A {(N4ێO!@A0nJꠟNz2a'44T*g@aWWWP0<ƩA@%Cnr}@[IɒK~`55E FBCϟe_v{y}ٽAVrщYζs:@i밒pUvqhu@ $AtQz{Hw wxzz&&Nڿ=Х .kbf sj=@a:H5] weGMᄄ ,,YUe;7GɸWFFƑK3kd+U"pK_z_K7>@TeQ gL<-t-ufRou^-~mwڊ햷y\k=_/Vtݻnݵw,OXD: E`Ӵ-?uWNC X0+[x8+3[ڊt6M~V,}(UtlW}'u"s" vjW 01%HD_!|C:$>m-,X,  0rN5;bFzr"u\tc11[r1:Ru@;h)14VWy]_qߥXg\X Tͯn3]D~>YgS\! jny`+ r۵N7w$NXoa{;GGπ y^eqdk0̕=Bl,q6VwBQЧէ`p#NkJOOuI9%=ѳ#uJ?G|G2@mG 斸 K dFX|ZdVkڕSS>v|,dYY"/ b֌6tE}E^n @p0cß!2~Vrv`J_JBB{]Td]rR ݜ` regIFuӧTTx{[|w稙Ξv 릲3y%̣+vDS@Ґlsp:XkKh`]Rw.UId&$&  @:fY=W9.Zi=ʆULr)z 9HI]_}b]$ˬ\*UuDyʥR9@İĥn耼\Vq<^QQ\`W|[`U]Mp~A;$4w+8s=u\-'$_|;R 5Xy/sh\TUP1ܼ>:WZxi۩.@XlᇉS'ٱcGKo$@Xo'Rq6q{~uQAA4==!h΍U͐d[/QAAi)]`<"!7/! kB\y%@XwvYog)7ݥN*jQ>|}pCDm@Vs8gm+.> Z {Vܘ p;`UQ߿6*RA n.җn./ߗ7EuG̓&kM7oNkmj]mOV6aHt(O4N[g(cۄy1嫋 R4 ^ ͝$+Wc e iu?9rq~]@^.+.yjm-${Iwx cDA{Hq=&;A\dܗnpH; p8"8;1hqS2`!SGAt*@j?Hṅg v7:iyIbZJ8 \^jg1,v^9=9Hn-g js뙸 p4MQd@Z8 p76O9(yP6`$;oT@vN:<fyX+=rdI < m*Q|r#*IJ6 tr &h`]I ^//mؿPPTUMY"Qm*] ț1.U. !(a 7gUIBJ,4PA h9 {zl9IENDB` cREVGeneral revUniqueID 1075472614744 EarthgrcKF>? cREVGeneral revUniqueID 1075472614745 Canon.pnggrcKFd3e cREVGeneral revUniqueID 1075472614748  LaunchVel)P% cREVGeneral revUniqueID 1075472614749  Launch velocity = 5.8 Labels@sF cREVGeneral revUniqueID 1075472614751  Earth   Instructions)hWW^` cREVGeneral revUniqueID 1075472614752  From Newton's Principia @ A centripetal force is that by which bodies are drawn or impelled, or any way tend, towards a point as a centre. Of this sort is gravity, by which bodies tend to the centre of the Earth; magnetism, by which iron tends to the load-stone; and that force, whatever it is, by which the planets are perpetually drawn aside from the rectilinear motions, which otherwise they would pursue, and made to revolve in curvilinear orbits. ...And the thing is to be understood of all bodies, revolved in any orbits. They all endeavour to recede from the centres of their orbits; and were it not for the opposition of a contrary force which restrains them to, and detains them in their orbits, which I therefore call centripetal, would fly off in right lines, with a uniform motion. A projectile, if it was not for the force of gravity, would not deviate towards the Earth, but would go off from it in a right line, and that with an uniform motion, if the resistance of the air was taken away. It is by its gravity that it is drawn aside perpetually from its rectilinear course, and made to deviate towards the Earth more or less, according to the force of its gravity, and the velocity of its motion. The less its gravity is, for the quantity of its matter, or the greater the velocity with which it is projected, the less will it deviate from a rectilinear course, and the farther it will go. If a leaden ball, projected from the top of a mountain by the force of gunpowder with a given velocity, and in a direction parallel to the horizon, is carried in a curve line to the distance of two miles before it falls to the ground; the same, if the resistance of the air were taken away, with a double or decuple velocity, would fly twice or ten times as far. @  And by increasing the velocity, we may at pleasure increase the distance to which it might be projected, and diminish the curvature of the line, which it might describe, till at last it should fall at the distance of 10, 30, or 90 degrees, or even might go quite round the whole Earth before it falls; or lastly, so that it might never fall to the Earth, but go forward into the celestial spaces, and proceed in its motion in infinitum. And after the same manner that a projectile, by the force of gravity, may be made to revolve in an orbit, and go round the whole Earth, the moon also, either by the force of gravity, if it is endued with gravity, or by any other force, that impels it towards the Earth, may be perpetually drawn aside towards the Earth, out of the rectilinear way, which by its innate force it would pursue; and would be made to revolve in the orbit which it now describes; nor could the moon without some such force, be retained in its orbit. If this force was too small, it would not sufficiently turn the moon out of a rectilinear course: if it was too great, it would turn it too much, and draw down the moon from its orbit towards the Earth. It is necessary, that the force be of a just quantity, and it belongs to the mathematicians to find the force, that may serve exactly to retain a body in a given orbit, with a given velocity; and vice versa, to determine the curvilinear way, into which a body projected from a given place, with a given velocity, may be made to deviate from its natural rectilinear way, by means of a given force. @+ @+ `g^ Instructions1)`WW cREVGeneral revUniqueID 1075472614753  PNewton began work on the most important problem of his day, the problem that had captured the imagination of all natural philosophers who preceded him, the problem in which man not only reached outside himself but beyond his planet to probe the mysteries of the solar system, those celestial bodies which followed rules unlike those of the other bright objects in the night sky. Kepler had discovered three ad hoc rules: The orbital trajectories are ellipses, the square of the period is proportional to the cube of the orbital radius, and the planet sweeps out equal areas in equal times. But could these rules be derived from first principles? How do we understand the motion of the planets in the solar system? His solution to this problem was surely the greatest achievement of science to that time. No problem had received greater attention. @O It is interesting to examine Newtons intuition at work on this problem. You may read his entry in the Principia in the field to the right. @ @n z To simulate his thought experiment drag the slider "Launch velocity" to set the launch velocity of the canon shot. @y"entropyCurve1KF1px492py 115.298872 pPenDowntruepPoints446,307 246,507 266,507 274,494 282,485 290,478 298,472 306,467 314,462 322,458 330,455 338,452 346,449 354,446 362,443 370,441 378,439 386,436 394,434 402,433 410,431 418,429 426,427 434,426 442,424 450,423 458,422 466,420 474,419 482,418 490,416 498,415 506,414 514,413 522,412 530,411 538,410 546,409 554,408 562,407 570,406 578,405 586,405 594,404 602,403 610,402 618,401 626,401 634,400 642,399 650,398 658,398 666,397 674,396 682,396 690,395 698,394 706,394 714,393 722,392 730,392 738,391 pAngle0?3 "*2:BJRZbjrz "*2:BJRZbjrz cREVGeneral revUniqueID 1074102565697#entropyCurve3KF""8px492py 307.463659 pPenDowntruepPoints446,307 246,507 266,507 274,474 282,450 290,431 298,415 306,401 314,389 322,378 330,369 338,360 346,352 354,345 362,338 370,331 378,325 386,320 394,314 402,309 410,305 418,300 426,296 434,291 442,287 450,284 458,280 466,276 474,273 482,270 490,266 498,263 506,260 514,257 522,255 530,252 538,249 546,247 554,244 562,242 570,239 578,237 586,235 594,232 602,230 610,228 618,226 626,224 634,222 642,220 650,218 658,216 666,214 674,212 682,211 690,209 698,207 706,205 714,204 722,202 730,201 738,199 pAngle0?3 "*2:BzJqRhZ`bYjRrKzE@:51,(#  "*2:BJRZbjrz cREVGeneral revUniqueID 1074103762062$slope1KFppx 181.810692py 82.426879 pPenDowntruepPoints 527,507 527,411 626,399 428,424 pAngle7.300616r cREVGeneral revUniqueID 1074105279453 %data)`bb֬O cREVGeneral revUniqueID 1074110482252 ! Question: @ @  PWhy is it that two bodies which can exchange heat come to the same temperature? @O Answer: @ Every macroscopic system seeks out the most probable state, the state of greatest entropy. Once it reaches this state it will remain there and for this reason it will be in a steady state, or equilibrium state. @ When two bodies exchange heat, energy is conserved, one body gains energy and the other loses an equal amount. Consequently, as one body gains energy it will lose entropy. Conversely the other body loses an equal amount of energy and gains entropy. But the entropy exchanges are not equal! This follows from the nature of the energy vs. entropy curve and the fact that the entropy change is equal to the heat energy divided by the absolute temperature (dS = dQ/T.) @ Now if one body gains more entropy than the other loses, there will be a net increase in entropy. Conversely, if one body loses more entropy than the other gains, there will a net loss in entropy. The entropy will be stationary, either a maximum or minimum, only when the entropy loss of one body is EQUAL to the gain of the other. This happens when the slopes of the two curves are equal. Since temperature is DEFINED as the reciprocal of the slope of the entropy vs. energy curve, it follows that the two temperatures will be equal. @ & `M'slope3KF-px 56.716901py 129.290584 pPenDowntruepPoints 385,507 385,320 467,264 303,377 pAngle34.6308@/y cREVGeneral revUniqueID 1074112478240( entropy1K@WW'_ cREVGeneral revUniqueID 1074284764757) entropy3K@WW""' cREVGeneral revUniqueID 1074284783584*axesKFjpx0py0 pPenDowntruepPoints1446,307 246,507 746,507 246,507 246,107 246,507 pAngle903k cREVGeneral revUniqueID 1074287481185 +slope3 % cREVGeneral revUniqueID 1074700599760 ! 197 ,slope1@`x% cREVGeneral revUniqueID 1074701130357 ! 934 -ordinateLabel ZR cREVGeneral revUniqueID 1074703523091 Entropy . absisaLabel M cREVGeneral revUniqueID 1074703528815 Energy / MaxEntropy h@!Used to measure the max entropy. cREVGeneral revUniqueID 1074703662393 ! Push me to the max. 0energy t& cREVGeneral revUniqueID 1074718681231 The total energy = 149 1 Instructions)ppon mouseMove put the mouseChunk into ChunkCode replace " " with "" in ChunkCode put the chunkCode of me into tLoc if tloc is empty then hide image "pointerFingerLeft.gif" hide image "pointerFingerRight.gif" exit mouseMove end if if "left" is in tLoc then put "pointerFingerLeft.gif" into theImage set the topleft of image theImage to item 1 of tLoc,item 2 of tLoc hide image "pointerFingerRight.gif" else put "pointerFingerRight.gif" into theImage set the topright of image theImage to item 1 of tLoc,item 2 of tLoc hide image "pointerFingerLeft.gif" end if show image theImage pass mouseMove end mouseMove on mouseEnter hide image "pointerFingerLeft.gif" hide image "pointerFingerRight.gif" end mouseEnter on mouseLeave hide image "pointerFingerLeft.gif" hide image "pointerFingerRight.gif" end mouseLeave blackWW}y char788to790offield8 785,435,Rightchar142to144offield8 661,497,Rightchar28to30offield8 270,192,Rightchar36to39offield8 411,187,Leftchar150to153offield8 363,499,Leftchar796to799offield8 796,338,Rightchar268to272offield8 774,506,Leftchar1407to1412offield8 385,193,Leftchar481to483offield8 414,412,Rightchar489to492offield8 488,254,Right cREVGeneral revUniqueID 1074729995231 ! Instructions: @  Two bodies (red and blue boxes below with the embedded yellow arrow) are in thermal contact and can exchange energy. The two (red and blue) buttons on the energy axis allow you to perform this heat energy exchange. Start with the red button to the far right on the energy axis. As you move the red button to the left, the heat energy of the red body decreases. At the same time, the blue body loses an equal amount of energy. (The total energy is conserved.) @ @blue  @ @blue @f @blue~ @ @blue @r @blue @  The red and blue curves define the entropy as a function of the energy. (These are realistic curves; red for an ideal monatomic gas, and the blue, a polyatomic ideal gas.) @ @blue @ @blue  @ @ The total entropy (red plus blue) is the sum of the red and blue systems individually. This sum is depicted by the combined height of the red and blue rectangles (below right with yellow outlines.) @ @blue @ @blue @0  The slope of the entropy vs. energy curves are represented by the black tangent lines. The inverse of the slope of these lines represents the temperature and that value is printed at the end of the tangent lines. @  Your task is to find those energies and temperatures which make the total entropy a maximum. You should push the yellow box (labeled "Push me to the max.") as high as possible. You should find that this occurs when the slopes (and therefore the temperatures) are equal. @ @ Three things should happen when the maximum entropy is reached: 1) The yellow arrow indicating the direction of heat flow should reverse direction, 2) the slopes should be equal, and 3) the "Push me to max" box should reach its maximum height. @G @blueG @M @ NSo now you know why heat exchange continues until the temperatures are equal. @M  (You may separately add heat energy to either body by holding down the shift key as you drag the energy box. The final temperature will depend on the total initial energy of the two bodies.)   You will notice that the (yellow) heat exchange arrow denotes the direction of heat (energy) flow. It reverses direction as the temeprature gradient reverses. This is also the state at which the entropy is a maximum. 2 `w3slope1@ plocal myName, myLoc, xxScale, yyScale, theEnergy,MouseDownOfMoverX,MouseDownOfMeX local tMoverName,tOldMax global tEnergy1,tEnergy2,temperature1,temperature3 on mousedown put the name of button "slope1"into myName send "setparams" to button "slope3" --tMoverName set the hilite of me to false setParams end mouseDown on setParams hide field "outOfBounds" put "slope3" into tMoverName put item 1 of the loc of button "slope1"into mouseDownOfMeX -- put mouseDownOfMeX into tEnergy1 -- put tEnergy1 + tEnergy2 into field "energy" put item 1 of the loc of button tMoverName into mouseDownOfMoverX put the loc of button "slope1"into myLoc put the height of this window into tOldMax set the bottom of field "MaxEntropy" to the top of grc "entropy3" put 50 into xxScale put 40 into yyScale put 8 into dx put 20 into xo put .05 into xxScale put 20 into yyScale put 60 into n st "slope1" setHome -200,-200 pu home end setParams on mouseUp set the energy of button "slope1"to theEnergy set the hilite of button "slope1"to true set the hilite of button "slope1"to false doMove the mouseH,the mouseV put "" into myName end mouseUp on mouseDoubleUP if the hilite of button "slope1"then set the hilite of button "slope1"to false else set the hilite of button "slope1"to true set the hilite of button "slope3" to false end if end mouseDoubleUP on mouseLeave put "" into myName end mouseLeave on mouseEnter put "" into myName end mouseEnter on mouseRelease put "" into myName end mouseRelease on mouseMove u,v if myName is "" or the hilite of button "slope1"is true then exit mouseMove checkOutOfBounds u,v if the shiftKey is down then set the loc of button "slope1" to u,item 2 of myLoc doMove u,v else send "doMove mouseDownOfMoverX-u+mouseDownOfMeX,y" to button tMoverName doMove u,v end if end mouseMove on doMove u,v checkOutOfBounds u,v Lock screen set the loc of button "slope1"to u,item 2 of myLoc put item 1 of mousePtToTurtlePt(u,v) into x if the shiftKey is down then set the energy of button "slope1" to x put the energy of button "slope1" + the energy of button "slope3" into the last word of field "energy" end if --put x into msg box cleanG "slope1" tell "slope1" clearLabel "slope1" pd setxy x,0 setxy x,y(x,1.5,1.2) put ycor() into entropy1 set the height of grc "entropy1" to entropy1 set the bottom of grc "entropy1" to 504 set the bottom of grc "entropy3" to the top of grc "entropy1" put the top of grc "entropy3" into tNewMax if tNewMax < tOldMax then set the bottom of field "maxEntropy" to the top of grc "entropy3" put tNewMax into tOldMax else set the bottom of field "maxEntropy" to tOldMax --put tNewMax into tOldMax end if pd put arcTangent(dyDx(x,1.5,1.2)) into temp seth temp fd 100 set the temperature of button "slope1" to 1/temp/.04*273 put 1/temp/.04*273 into temperature1 label trunc(the temperature of button "slope1"),"slope1" if the temperature of button "slope1" > the temperature of button "slope3" then set the startArrow of grc "HeatArrow" to false set the endArrow of grc "HeatArrow" to true else set the startArrow of grc "HeatArrow" to true set the endArrow of grc "HeatArrow" to false end if -- pu -- bk 100 -- pd bk 200 -- unLock screen end doMove function y x,a,b if x <.001 then exit y return yyScale*b*ln((xxScale*x)^a) end y function dyDx x,a,b if x < .001 then exit dyDx return a*yyScale*b/x end dyDx on checkOutOfBounds u,v if u < 270 then set the loc of button "slope1" to 270 ,item 2 of myLoc show field "outOfBounds" exit to top else hide field "outOfBounds" if u > 720 then set the loc of button "slope1" to 720,item 2 of myLoc show field "outOfBounds" exit to top else hide field "outOfBounds" end checkOutOfBounds @energy temperature 934.852643)Use the shift key to move independently.' cREVGeneral scriptChecksumRYy/t|R breakPoints39 handlerListumousedown setParams mouseUp mouseDoubleUP mouseLeave mouseEnter mouseRelease mouseMove doMove y dyDx checkOutOfBoundsscriptSelectionchar 3439 to 3444 revUniqueID 1074103926706 bookmarks tempScript prevHandlercheckOutOfBoundsscriptd

local myName, myLoc, xxScale, yyScale, theEnergy,MouseDownOfMoverX,MouseDownOfMeX

local tMoverName,tOldMax

global tEnergy1,tEnergy2,temperature1,temperature3

on mousedown

put the name of button "slope1"into myName

send "setparams" to button "slope3" --tMoverName

set the hilite of me to false

setParams

end mouseDown

on setParams

hide field "outOfBounds"

put "slope3" into tMoverName

put item 1 of the loc of button "slope1"into mouseDownOfMeX

-- put mouseDownOfMeX into tEnergy1

-- put tEnergy1 + tEnergy2 into field "energy"

put item 1 of the loc of button tMoverName into mouseDownOfMoverX

put the loc of button "slope1"into myLoc

put the height of this window into tOldMax

set the bottom of field "MaxEntropy" to the top of grc "entropy3"

put 50 into xxScale

put 40 into yyScale

put 8 into dx

put 20 into xo

put .05 into xxScale

put 20 into yyScale

put 60 into n

st "slope1"

setHome -200,-200

pu

home

end setParams

on mouseUp

set the energy of button "slope1"to theEnergy

set the hilite of button "slope1"to true

set the hilite of button "slope1"to false

doMove the mouseH,the mouseV

put "" into myName

end mouseUp

on mouseDoubleUP

if the hilite of button "slope1"then

set the hilite of button "slope1"to false

else

set the hilite of button "slope1"to true

set the hilite of button "slope3" to false

end if

end mouseDoubleUP

on mouseLeave

put "" into myName

end mouseLeave

on mouseEnter

put "" into myName

end mouseEnter

on mouseRelease

put "" into myName

end mouseRelease

on mouseMove u,v

if myName is "" or the hilite of button "slope1"is true then exit mouseMove

checkOutOfBounds u,v

if the shiftKey is down then

set the loc of button "slope1" to u,item 2 of myLoc

doMove u,v

else

send "doMove mouseDownOfMoverX-u+mouseDownOfMeX,y" to button tMoverName

doMove u,v

end if

end mouseMove

on doMove u,v

checkOutOfBounds u,v

-- Lock screen

set the loc of button "slope1"to u,item 2 of myLoc

put item 1 of mousePtToTurtlePt(u,v) into x

if the shiftKey is down then

set the energy of button "slope1" to x

put the energy of button "slope1" + the energy of button "slope3" into the last word of field "energy"

end if

--put x into msg box

cleanG "slope1"

tell "slope1"

clearLabel "slope1"

pd

setxy x,0

setxy x,y(x,1.5,1.2)

put ycor() into entropy1

set the height of grc "entropy1" to entropy1

set the bottom of grc "entropy1" to 504

set the bottom of grc "entropy3" to the top of grc "entropy1"

put the top of grc "entropy3" into tNewMax

if tNewMax < tOldMax then

set the bottom of field "maxEntropy" to the top of grc "entropy3"

put tNewMax into tOldMax

else

set the bottom of field "maxEntropy" to tOldMax

--put tNewMax into tOldMax

end if

pd

put arcTangent(dyDx(x,1.5,1.2)) into temp

seth temp

fd 100

set the temperature of button "slope1" to 1/temp/.04*273

put 1/temp/.04*273 into temperature1

label trunc(the temperature of button "slope1"),"slope1"

if the temperature of button "slope1" > the temperature of button "slope3" then

set the startArrow of grc "HeatArrow" to false

set the endArrow of grc "HeatArrow" to true

else

set the startArrow of grc "HeatArrow" to true

set the endArrow of grc "HeatArrow" to false

end if

-- pu

-- bk 100

-- pd

bk 200

-- unlock screen

end doMove

function y x,a,b

if x <.001 then exit y

return yyScale*b*ln((xxScale*x)^a)

end y

function dyDx x,a,b

if x < .001 then exit dyDx

return a*yyScale*b/x

end dyDx

on checkOutOfBounds u,v

if u < 270 then

set the loc of button "slope1" to 270 ,item 2 of myLoc

show field "outOfBounds"

exit to top

else hide field "outOfBounds"

if u > 720 then

set the loc of button "slope1" to 720,item 2 of myLoc

show field "outOfBounds"

exit to top

else hide field "outOfBounds"

end checkOutOfBounds

!4slope3@ wlocal myName, myLoc, xxScale, yyScale,theEnergy,mouseDownOfMeX,mouseDownOfMoverX local tMoverName ,tOldMax global tEnergy1, tEnergy2,temperature1,temperature3 on mousedown put the name of button "slope3" into myName set the hilite of me to false send "setParams" to button "slope1" setParams end mouseDown on setParams hide field "outOfBounds" put "slope1" into tMoverName put item 1 of the loc of button "slope3" into mouseDownOfMeX put item 1 of the loc of button tMoverName into mouseDownOfMoverX --put the name of button "slope3" into myName put the loc of button "slope3" into myLoc put 50 into xxScale put 40 into yyScale put 8 into dx put 20 into xo put .05 into xxScale put 20 into yyScale put 60 into n put the points of grc "slope3" into temp st "slope3" setHome -200,-200 pu home set the points of grc "slope3" to temp set the bottom of field "MaxEntropy" to the top of grc "entropy3" put the height of this window into tOldMax end setParams on mouseDoubleUP if the hilite of button "slope3" then set the hilite of button "slope3" to false else set the hilite of button "slope3" to true set the hilite of button "slope1" to false end if end mouseDoubleUP on mouseUp put "" into myName set the energy of button "slope3" to theEnergy set the hilite of button "slope3" to true set the hilite of button "slope3" to false end mouseUp on mouseLeave put "" into myName end mouseLeave on mouseRelease put "" into myName end mouseRelease on mouseMove u,v if myName is "" or the hilite of button "slope3" is true then exit mouseMove checkOutOfBounds u,v if the shiftKey is down then set the loc of button "slope3" to u,504 doMove u,v else send "doMove mouseDownOfMoverX - u + mouseDownOfMeX,v" to button tMoverName doMove u,v end if end mouseMove on doMove u,v checkOutOfBounds u,v Lock screen set the loc of button "slope3" to u,item 2 of myLoc put item 1 of mousePtToTurtlePt(u,v) into x if the shiftKey is down then set the energy of me to x put x + the energy of button "slope1" into the last word of field "energy" end if cleanG "slope3" tell "slope3" clearLabel "slope3" pd setxy x,0 setxy x, y(x,3,1.6) put ycor() into entropy3 Lock screen set the height of grc "entropy3" to entropy3 set the bottom of grc "entropy3" to the top of grc "entropy1" put the top of grc "entropy3" into tNewMax if tNewMax < tOldMax then set the bottom of field "maxEntropy" to the top of grc "entropy3" put tNewMax into tOldMax else set the bottom of field "maxEntropy" to tOldMax pd put arcTangent(dyDx(x,3,1.6)) into temp seth temp fd 100 set the temperature of me to 1/temp/.04*273 label trunc(the temperature of me),"slope3" put 1/temp into Temperature3 if the temperature of button "slope1" > the temperature of button "slope3" then set the startArrow of grc "HeatArrow" to false set the endArrow of grc "HeatArrow" to true else set the startArrow of grc "HeatArrow" to true set the endArrow of grc "HeatArrow" to false end if --pu bk 200 -- pd -- bk 100 -- unLock screen end doMove function y x,a,b if x <.001 then exit y return yyScale*b*ln((xxScale*x)^a) end y function dyDx x,a,b if x < .001 then exit dyDx return a*yyScale*b/x end dyDx on checkOutOfBounds u,v if u < 270 then set the loc of button "slope3" to 270 ,item 2 of myLoc show field "outOfBounds" exit to top else hide field "outOfBounds" if u > 720 then set the loc of button "slope3" to 720,item 2 of myLoc show field "outOfBounds" exit to top else hide field "outOfBounds" end checkOutOfBounds ""@zenergy temperature 197.078899hhilitefalse)Use the shift key to move independently.+ cREVGeneral scriptChecksum$9U:<`_oġOg handlerListjmousedown setParams mouseDoubleUP mouseUp mouseLeave mouseRelease mouseMove doMove y dyDx checkOutOfBounds breakPoints78scriptSelectionchar 2551 to 2550 bookmarks revUniqueID 1074112354870 prevHandlercheckOutOfBounds tempScriptscript-

local myName, myLoc, xxScale, yyScale,theEnergy,mouseDownOfMeX,mouseDownOfMoverX

local tMoverName ,tOldMax

global tEnergy1, tEnergy2,temperature1,temperature3

on mousedown

put the name of button "slope3" into myName

set the hilite of me to false

send "setParams" to button "slope1"

setParams

end mouseDown

on setParams

hide field "outOfBounds"

put "slope1" into tMoverName

put item 1 of the loc of button "slope3" into mouseDownOfMeX

put item 1 of the loc of button tMoverName into mouseDownOfMoverX

--put the name of button "slope3" into myName

put the loc of button "slope3" into myLoc

put 50 into xxScale

put 40 into yyScale

put 8 into dx

put 20 into xo

put .05 into xxScale

put 20 into yyScale

put 60 into n

put the points of grc "slope3" into temp

st "slope3"

setHome -200,-200

pu

home

set the points of grc "slope3" to temp

set the bottom of field "MaxEntropy" to the top of grc "entropy3"

put the height of this window into tOldMax

end setParams

on mouseDoubleUP

if the hilite of button "slope3" then

set the hilite of button "slope3" to false

else

set the hilite of button "slope3" to true

set the hilite of button "slope1" to false

end if

end mouseDoubleUP

on mouseUp

put "" into myName

set the energy of button "slope3" to theEnergy

set the hilite of button "slope3" to true

set the hilite of button "slope3" to false

end mouseUp

on mouseLeave

put "" into myName

end mouseLeave

on mouseRelease

put "" into myName

end mouseRelease

on mouseMove u,v

if myName is "" or the hilite of button "slope3" is true then exit mouseMove

checkOutOfBounds u,v

if the shiftKey is down then

set the loc of button "slope3" to u,504

doMove u,v

else

send "doMove mouseDownOfMoverX - u + mouseDownOfMeX,v" to button tMoverName

doMove u,v

end if

end mouseMove

on doMove u,v

checkOutOfBounds u,v

-- Lock screen

set the loc of button "slope3" to u,item 2 of myLoc

put item 1 of mousePtToTurtlePt(u,v) into x

if the shiftKey is down then

set the energy of me to x

put x + the energy of button "slope1" into the last word of field "energy"

end if

cleanG "slope3"

tell "slope3"

clearLabel "slope3"

pd

setxy x,0

setxy x, y(x,3,1.6)

put ycor() into entropy3

-- Lock screen

set the height of grc "entropy3" to entropy3

set the bottom of grc "entropy3" to the top of grc "entropy1"

put the top of grc "entropy3" into tNewMax

if tNewMax < tOldMax then

set the bottom of field "maxEntropy" to the top of grc "entropy3"

put tNewMax into tOldMax

else set the bottom of field "maxEntropy" to tOldMax

pd

put arcTangent(dyDx(x,3,1.6)) into temp

seth temp

fd 100

set the temperature of me to 1/temp/.04*273

label trunc(the temperature of me),"slope3"

put 1/temp into Temperature3

if the temperature of button "slope1" > the temperature of button "slope3" then

set the startArrow of grc "HeatArrow" to false

set the endArrow of grc "HeatArrow" to true

else

set the startArrow of grc "HeatArrow" to true

set the endArrow of grc "HeatArrow" to false

end if

--pu

bk 200

-- pd

-- bk 100

-- unlock screen

end doMove

function y x,a,b

if x <.001 then exit y

return yyScale*b*ln((xxScale*x)^a)

end y

function dyDx x,a,b

if x < .001 then exit dyDx

return a*yyScale*b/x

end dyDx

on checkOutOfBounds u,v

if u < 270 then

set the loc of button "slope3" to 270 ,item 2 of myLoc

show field "outOfBounds"

exit to top

else hide field "outOfBounds"

if u > 720 then

set the loc of button "slope3" to 720,item 2 of myLoc

show field "outOfBounds"

exit to top

else hide field "outOfBounds"

end checkOutOfBounds

!5RedBody@ `@::energy176)Use the shift key to move independently.' cREVGeneral revUniqueID 1074779452047 breakPoints !6 BlueBody@ g""@T::energyhhilitefalse)Use the shift key to move independently.+ cREVGeneral revUniqueID 1074779458320 breakPoints78 !7 HeatArrow@KF0E:k cREVGeneral revUniqueID 1074779722901 8 HeatLabel #c cREVGeneral revUniqueID 1074781186232 Heat exchange 9 outOfBoundsx$ cREVGeneral revUniqueID 1075472789465 Out of bounds: DrawCurvesEplocal xxScale,yyScale on mouseUP put 8 into dx put 20 into xo put .05 into xxScale put 20 into yyScale put 60 into n st "axes" tell "axes" setHome -200,-200 pu home pd fd 500 bk 500 seth 90 fd 400 bk 400 st "entropyCurve1" tell "entropyCurve1" setHome -200,-200 pu home pd put xo into x repeat n setxy x,y(x,1.5,1.2) --pr x&&y(x,2.5,1.5) add dx to x end repeat st "entropyCurve3" tell "entropyCurve3" setHome -200,-200 pu home pd put xo into x repeat n times setxy x,y(x,3,1.6) add dx to x end repeat end mouseUP function y x,a,b return yyScale*b*ln((xxScale*x)^a) end y $T" cREVGeneral revUniqueID 1075473030749 breakPoints3 8 Graphic 1@KFI cREVGeneral revUniqueID 10756428883359 Graphic 2@KF_>l cREVGeneral revUniqueID 1075642916856 canon.pngKFdpx0py206 pPenDownfalsepPoints446,307 446,101 pAngle03e cREVGeneral revUniqueID 1075667866412Ball`@Tpx3.722865py 213.025784 pPenDowntruepPoints446,307 446,101 446,94 452,94 458,94 463,95 469,95 475,96 481,97 486,98 492,99 498,100 503,102 509,104 514,106 520,108 525,110 530,112 536,115 541,118 546,121 551,124 556,127 560,130 565,134 570,138 574,142 579,146 583,150 587,154 591,158 595,163 599,168 602,172 606,177 609,182 612,188 615,193 618,198 621,204 623,209 625,215 627,221 629,227 631,233 633,239 634,245 635,251 636,257 637,264 638,270 638,276 638,283 638,289 638,296 638,302 637,308 636,315 635,321 633,328 632,334 630,341 628,347 626,353 623,360 620,366 618,372 614,378 611,384 607,389 603,395 599,401 595,406 591,411 586,417 581,422 576,426 571,431 565,436 560,440 554,444 548,448 542,451 535,455 529,458 522,461 516,464 509,466 502,468 495,470 488,472 481,473 473,474 466,475 459,476 452,476 444,476 437,476 430,475 422,474 415,473 408,472 401,470 394,468 387,466 380,463 373,461 367,458 360,454 354,451 348,447 342,443 336,439 330,434 325,430 319,425 314,420 309,415 305,410 300,404 296,399 292,393 288,387 284,381 281,375 278,369 275,362 272,356 270,350 268,343 266,336 264,330 263,323 261,317 260,310 260,303 259,297 259,290 259,284 259,277 259,270 260,264 261,257 262,251 263,245 265,238 266,232 268,226 270,220 272,214 275,208 277,203 280,197 283,192 286,186 290,181 293,176 297,171 300,166 304,161 308,157 312,152 317,148 321,144 325,140 330,136 335,132 340,129 345,125 350,122 355,119 360,116 365,114 370,111 376,109 381,106 387,104 392,103 398,101 404,99 409,98 415,97 421,96 427,95 432,95 438,94 444,94 450,94 pAngle0 cREVGeneral revUniqueID 1075472614742 BallgrcKF\3e^^^__`abcdfhjl npsv"y'|,05:>CGKOSWZ^adgjmoqsuwyz{|}~~~~!~(~.}4|;{AyHxNvUt[raohlnjtfzc_[WSOJE@;50*$ |uohb\VPJE?:51,($ }wqjd^ W PJC=6/)"   "%),048=AEJOTY}^zcwhtmrroxm}jhgecba`__^^^ cREVGeneral revUniqueID 1075669435936i/ cREVGeneral revUniqueID 1075756477078 TabButton}>on menupick go to card the selectedtext of me end menupick @]]dw$Introduction Phase Space Resolution cREVGeneral revUniqueID 1075756342801 Field 3   cREVGeneral revUniqueID 1075756366689 The Asymmetry of Time ZField 1 , 8 cREVGeneral revUniqueID 1077130768327 bookmarks handlerList tempScript prevHandlerscriptSelection char 1 to 0script 6Newton's thought experiment on the nature of gravity. @5 QChoose a power law on menupick tItem switch tItem case "inverse square" set the power of this card to 2 break case "inverse cube" set the power of this card to 3 break case "inverse first power" set the power of this card to 1 break end switch end menupick #xInverse square0Inverse square Inverse cube Inverse first power cREVGeneral revUniqueID 1079368782327 bookmarks handlerListmenupick tempScript prevHandlermenupickscriptSelection char 1 to 17script  S TimeAppsII TFileŋU@--The following menuPick handler was generated by the Menu Builder. on menuPick pWhich switch pWhich case "Return to main menu" go to stack "A paradox in time" break --Insert script for Item 2 menu item here case "Quit" quit --Insert script for Quit menu item here break end switch end menuPick T&Quit/Q cREVGeneral  UHelpŋU--The following menuPick handler was generated by the Menu Builder. on menuPick pWhich switch pWhich case "return to main menu" go to stack "a paradox in time" --Insert script for Help menu item here break case "About" go to stack "about" break end switch end menuPick "T&Return to main menu - &About cREVGeneral  XInstructions1)`WW M cREVGeneral revUniqueID 1079638458647  In Newton's law, the gravitational force is inversely proportional to the square of the distance between the two gravitating bodies. You may experiment with alternatives. As you will see, the alternatives do not agree with observation. @ Y Scrollbar 2q0local n global x0,y0 on scrollbardrag newValue put "Launch velocity = " & newValue/10 into field "launchVel" set the textStyle of field "launchVel" to bold set the textSize of field "LaunchVel" to 18 end scrollbardrag on mouseUP set the stopMe of this card to false fireCanon end mouseUP on fireCanon global x0,y0 set the loc of grc "earth" to x0,y0 startTurtle "canon.png" pu setxy 0,206 put xycor() into tCanonLoc st "ball" tell "ball" put the power of this card into n pu setxy tCanonLoc incxy 0,7 --put xycor() into r0 put last word of field "launchVel" into vx put 0 into vy pd repeat until distance(0,0) <150 --Hit the ground put xcor() into xOld incxy vx,vy add accx() to vx add accy() to vy if xOld <0 and xcor()>0 then exit repeat --One revolution if offScreen() then answer "Off to outer space." with "OK" exit repeat end if --if the stopme of this card is true then exit Repeat end repeat end fireCanon function accx -- Newton's law of gravity return -8100 * xcor()/ (distance(0,0)^(n+1))*150^(n-2) end accx function accy return -8100 * ycor()/ (distance(0,0)^(n+1))*150^(n-2) end accy function offScreen if the loc of button "ball" is not within 0,0,2*x0,2*y0 then return true else return false end offScreen I 5DDL67 cREVGeneral revUniqueID 1079717422201 bookmarks handlerList3scrollbardrag mouseUP fireCanon accx accy offScreen tempScript prevHandleraccxscriptSelectionchar 1212 to 1217script PointerFingerLeft.gif@HGIF89aH̙̙̙̙fffffffff3f33333!,HH9'k0(Ul뾬5t4K:B^aP,n"@8`Ш0A6 aV(YHXɂ!i%@KXf d]pZZdruw0:XW^C&d c{$-#47 j~WWX ~Lcdc t mJ?{ , CL^cc#2 @L=y@,1MIPL1`=v2 q`W``ER句].|R@Ǡ FBFb)2)PE;#(Jyf# "H AER( # )k1RhF,C+Cm:1%3 [.J` O 6&ڮY;Gz}6Q {1vTHKW{Zc P cԕhkX30&;p9x0"Ki3Ǵ補d%C^u; ߑs&։V;^rN!eh5wԄWjy* 4@] nt@+H.IQ0"^lc` UeNrnN{=J)O`$|`C䀭DCIF*d@BpD((A; cREVGeneral revUniqueID 1080922289974 PointerFingerRight.gif@MHGIF89aH̙̙̙̙fffffffff3f33333!,HI1Iޡx @X,;@w(!@ĠQl*`L(|/ NK&$8Pe)`VKkm|_r9 p wy{r~Z fi|ems"vy|}q j}jn O) rqqg: ^!(5(ƪ o˕8qpodfeX  诉FI$囼0nj,?7)%AI5 "8_ XE ʌ a8nTQS{q8.2v,3A`@t=ger((cHXY٨|&/?AɮSCCQM-)"^aƑ6m?5Wˁ&s䘀]iHW.6^w0cӍp9j8|U`]Jg ^On^f*kj; VL ׬ƻMP^\Mg\I%`ilQG4ltEXIZT[I= Vx(?_F[gl`f"IOJ=Ss],tW.  -VApM}2v^@HѤ< ^V!N }9-ŴN0J; cREVGeneral revUniqueID 1080922289978 Fixed for OS XEpon mouseUP put the script of this card into tScript if "-- Wait 0 millisec" is in tScript then replace "-- Wait 0 millisec" with "Wait 0 millisec" in tScript set the name of the target to "Fixed for OS X" else replace "Wait 0 millisec" with "-- Wait 0 millisec" in tScript set the name of the target to "Not fixed for OS X" end if set the script of this card to tScript end mouseUP k#; cREVGeneral scriptChecksumԛ̭&O)yF* breakPoints2 handlerListmouseUPscriptSelectionchar 389 to 388 bookmarks revUniqueID 1105884534186 prevHandlermouseUP tempScriptscript

on mouseUP

put the script of this card into tScript

if "-- Wait 0 millisec" is in tScript then

replace "-- Wait 0 millisec" with "Wait 0 millisec" in tScript

set the name of the target to "Fixed for OS X"

else

replace "Wait 0 millisec" with "-- Wait 0 millisec" in tScript

set the name of the target to "Not fixed for OS X"

end if

set the script of this card to tScript

end mouseUP

 Not fixed for OS XEpon mouseUP put the script of this card into tScript put the script of button "slope3" into tBlueButtonScript put the script of button "slope1" into tRedButtonScript if "-- Lock screen" is in tScript then replace "-- Lock screen" with "Lock screen" in tBlueButtonScript replace "-- Lock screen" with "Lock screen" in tRedButtonScript replace "-- Lock screen" with "Lock screen" in tScript set the name of the target to "Not fixed for OS X" else replace "Lock screen" with "-- Lock screen" in tBlueButtonScript replace "Lock screen" with "-- Lock screen" in tRedButtonScript replace "Lock screen" with "-- Lock screen" in tScript set the name of the target to "Fixed for OS X" end if set the script of this card to tScript set the script of button "slope3"to tBlueButtonScript set the script of button "slope1" to tRedButtonScript end mouseUP }.#; cREVGeneral scriptChecksum{' n8bPM^f breakPoints2 handlerListmouseUPscriptSelectionchar 705 to 704 bookmarks revUniqueID 1105884534186 prevHandlermouseUP tempScriptscript

on mouseUP

put the script of this card into tScript

put the script of button "slope3" into tBlueButtonScript

put the script of button "slope1" into tRedButtonScript

if "-- Lock screen" is in tScript then

replace "-- Lock screen" with "Lock screen" in tBlueButtonScript

replace "-- Lock screen" with "Lock screen" in tRedButtonScript

replace "-- Lock screen" with "Lock screen" in tScript

set the name of the target to "Not fixed for OS X"

else

replace "Lock screen" with "-- Lock screen" in tBlueButtonScript

replace "Lock screen" with "-- Lock screen" in tRedButtonScript

replace "Lock screen" with "-- Lock screen" in tScript

set the name of the target to "Fixed for OS X"

end if

set the script of this card to tScript

set the script of button "slope3"to tBlueButtonScript

set the script of button "slope1" to tRedButtonScript

end mouseUP

! NextEp(on mouseUP go to Next card end mouseUP B0#= cREVGeneral scriptChecksum. JRp l handlerListmouseUP breakPoints2scriptSelection char 18 to 17 revUniqueID 1105885458626 bookmarks tempScript prevHandlermouseUPscript

on mouseUP

go to Next card

end mouseUP

! NextEp(on mouseUP go to Next card end mouseUP o7#= cREVGeneral scriptChecksum. JRp l handlerListmouseUP breakPointsscriptSelection char 17 to 17 revUniqueID 1105885509040 bookmarks tempScript prevHandlermouseUPscript

on mouseUP

go to Next card

end mouseUP