Bearing: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 1: Line 1:
<html>
<form>
<input type="text" id="degrees">
</form>
</html>
<jsxgraph width="600" height="500">
<jsxgraph width="600" height="500">
var brd = JXG.JSXGraph.initBoard('jxgbox',{axis:true,boundingbox:[-2,1.5,2,-1.5],keepaspectratio:true});
var brd = JXG.JSXGraph.initBoard('jxgbox',{axis:true,boundingbox:[-2,1.5,2,-1.5],keepaspectratio:true});
var c = brd.create('circle',[[0,0],1]);
var c = brd.create('circle',[[0,0],1]);
var p = brd.create('glider',[-1,0.5,c],{name:'drag me'});  
var p = brd.create('glider',[-1,0.5,c],{name:'drag me'});  
/*
brd.addHook(function(){
var eps = brd.create('slider',[[2,7],[6,7],[-6,0.5,6]]); brd.createElement('text',[1,7,'&epsilon;:']);
                  document.getElementById('degrees').value = (Math.atan2(p.X(),ppY())*180/Math.PI).toFixed(1);
var len = brd.create('slider',[[2,6],[6,6],[0,3,6]]); brd.createElement('text',[1,6,'len:']);
            });
var rho = brd.create('slider', [[2,5],[6,5],[0,0,2*Math.PI]]); brd.createElement('text',[1,5,'&rho;:']);
var f = brd.create('curve',
  [function(phi) { return p.Value()/(1-eps.Value()*Math.cos(phi+rho.Value())); }, [1,0], 0,function(){return len.Value()*Math.PI}],     
  {curveType:'polar', strokewidth:2, strokeColor:'#CA7291'}
  );       
var q = brd.createElement('glider', [f], {style:6,name:'G'});
brd.createElement('tangent', [q], {dash:3});
*/
//brd.addHook(function(){document.getElementById('ausgabe').innerHTML = (p.Value()).toFixed(1) + "/(1 - (" + (eps.Value()).toFixed(1) //+ ")*cos(&phi;+"+(rho.Value()).toFixed(1) +"))";});
</jsxgraph>
</jsxgraph>

Revision as of 16:08, 16 June 2010