Created
February 14, 2012 02:14
-
-
Save kenwebb/1822554 to your computer and use it in GitHub Desktop.
Displacement from Time and Velocity Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!--Xholon Workbook http://www.primordion.com/Xholon/wb/ (C) Ken Webb Mon Feb 13 2012 21:14:52 GMT-0500 (EST)--> | |
<XholonWorkbook> | |
<Notes><![CDATA[ | |
Khan Academy | |
------------ | |
Title: Displacement from Time and Velocity Example | |
Description: Worked example of calculating displacement from time and velocity | |
Url: http://www.khanacademy.org/video/displacement-from-time-and-velocity-example?playlist=Physics | |
InternalName: displacement-from-time-and-velocity-example | |
YoutubeId: lQ-dvt3V4yQ | |
Keywords: physics, displacement, distance, rate, time | |
My Notes | |
-------- | |
see code | |
]]></Notes> | |
<script implName="lang:python:inline:"><![CDATA[ | |
t = 1 * 60 | |
v = 5 | |
direction = "south" | |
s = v * t | |
print str(s) + " meters to the " + direction | |
# http://ideone.com/VOne2 | |
]]></script> | |
<script implName="lang:javascript:inline:"><![CDATA[ | |
var t = 1 * 60; | |
var v = 5; | |
var direction = "south"; | |
var s = v * t; | |
println(s + " meters to the " + direction); | |
//javascript:(function(){var t=1*60;var v=5;var direction="south";var s=v*t;alert(s+" meters to the "+direction);})() | |
]]></script> | |
<_-.XholonClass> | |
<!-- domain objects --> | |
<PhysicalSystem/> | |
<Block/> | |
<!-- quantities --> | |
<Height superClass="Length"/> | |
</_-.XholonClass> | |
<xholonClassDetails> | |
<Block> | |
<port name="height" connector="#xpointer(Height)"/> | |
</Block> | |
</xholonClassDetails> | |
<PhysicalSystem> | |
<Block> | |
<Height>0.1 m</Height> | |
</Block> | |
</PhysicalSystem> | |
<Blockbehavior implName="lang:python:inline:"><![CDATA[ | |
# This works if pasted in as a last child of Block. | |
height.incVal(0.02) | |
print("Python wants something to do. Height:" + str(height)) | |
]]></Blockbehavior> | |
<Blockbehavior implName="lang:javascript:inline:"><![CDATA[ | |
// This works if pasted in as a last child of Block. | |
height.incVal(0.02); | |
print("JavaScript wants something to do. Height:" + height + "\n"); | |
]]></Blockbehavior> | |
<Blockbehavior implName="lang:bsh:inline:"><![CDATA[ | |
// This works if pasted in as a last child of Block. | |
height.incVal(0.02); | |
System.out.print("Java/Beanshell wants something to do. Height:" + height + "\n"); | |
]]></Blockbehavior> | |
<Blockbehavior implName="lang:jruby:inline:"><![CDATA[ | |
require 'java' | |
# This works if pasted in as a last child of Block. | |
$height.incVal(0.02) | |
puts "Ruby wants something to do. Height: #{$height}" | |
]]></Blockbehavior> | |
<Blockbehavior implName="lang:groovy:inline:"><![CDATA[ | |
// This works if pasted in as a last child of Block. | |
height.incVal(0.02); | |
System.out.print("Groovy wants something to do. Height:" + height + "\n"); | |
]]></Blockbehavior> | |
<SvgClient><Attribute_String roleName="svgUri"><![CDATA[data:image/svg+xml, | |
]]></Attribute_String><Attribute_String roleName="setup">${MODELNAME_DEFAULT},${SVGURI_DEFAULT}</Attribute_String></SvgClient> | |
</XholonWorkbook> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment