1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
<html>
<head>
<title>JSXGraph example</title>
<link rel="stylesheet" type="text/css" href="../distrib/jsxgraph.css" />
<script type="text/javascript" src="../distrib/jsxgraphcore.js"></script>
</head>
<body>
<h2>Transformations</h2>
<div id="jxgbox" class="jxgbox" style="width:700px; height:500px;"></div>
<div id="debug" style="display:none;"></div>
<script type="text/javascript">
/* <![CDATA[ */
board = JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [-10, 10, 10, -10], grid: true, pan: true, zoom: true, axis: true, pan: {needShift: false}});
shearsx = board.createElement('slider', [[-8,9], [7,9], [-2.5,0,2.5]], {name:'X shear', snapWidth:0.1});
shearsy = board.createElement('slider', [[-9,8], [-9,-7], [2.5,0,-2.5]], {name:'Y shear', snapWidth:0.1});
shearimg = board.create('image',["uccellino.jpg", [1, 1], [3, 3]], {fixed: true});
sheartransform = board.create('transform', [
function() { return shearsx.Value(); },
function() { return shearsy.Value(); }], {type:'shear'});
sheartransform.bindTo(shearimg);
board.update();
/* ]]> */
</script>
</body>
</html>
|