Skip to content

Instantly share code, notes, and snippets.

@jasongrout
Created November 1, 2011 02:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasongrout/1329698 to your computer and use it in GitHub Desktop.
Save jasongrout/1329698 to your computer and use it in GitHub Desktop.
TEXT(<<'EOF');
<div id="singlecell-test"><script type="text/code">var('x')
x0 = 0
f(x) = sin(x)*e^(-x)
p = plot(f,(x,-1,5), thickness=2)
dot = point((x0,f(x=x0)),pointsize=80,rgbcolor=(1,0,0))
@interact
def _(order=(1..12)):
ft = f.taylor(x,x0,order)
pt = plot(ft,(x,-1, 5), color='green', thickness=2)
show(dot + p + pt, ymin = -.5, ymax = 1)
</script></div>
<script type="text/javascript" src="http://sagemath.org:5467/static/jquery-1.5.min.js"></script>
<script type="text/javascript" src="http://sagemath.org:5467/embedded_singlecell.js"></script>
<script type="text/javascript">
$(function() { // load only when the page is loaded
var makecells = function() {
singlecell.makeSinglecell({
inputLocation: "#singlecell-test",
editor: "codemirror",
hide: ["editor","computationID","files","messages","sageMode"],
evalButtonText: "Explore",
replaceOutput: true});
}
singlecell.init(makecells); // load Single Cell libraries and then
// initialize Single Cell instances
});
</script>
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment