Skip to content

Commit

Permalink
Remove a dif by zero in parabola.
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredwassermann committed Feb 4, 2013
1 parent c3a4fa3 commit e6c714a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
9 changes: 5 additions & 4 deletions examples/construct.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
};


var brd = JXG.JSXGraph.initBoard('jxgbox',{boundingbox: [-1,5,5,-1], axis:true});
var brd = JXG.JSXGraph.initBoard('jxgbox',{boundingbox: [-4,5,5,-4], axis:true});

// Create two arcs
//var l = brd.create('line', [-1,1,0]);
/*
Expand Down Expand Up @@ -92,14 +92,15 @@
}
);
*/

/*
var p1 = brd.create('point', [3,2], {withLabel:true, name:'FREEZE', frozen:false, visible:true});
var p2 = brd.create('point', [3,1], {snapToPoints: false, visible:true});
var s1 = brd.create('slider', [[1,3],[4,3],[10,40,110]],
{ point1:{frozen:true},
point2:{frozen:true},
ticks:{drawLabels:true}
});
*/
//brd.create('segment', [p1,p2], {strokeWidth:20, highlightStrokeWidth:2, firstArrow:true, lastArrow:true});
/*
var t1 = brd.create('text', [1,2,'hello'], {snapToGrid:true});
Expand Down Expand Up @@ -141,7 +142,7 @@
brd.update();
*/

var tape = brd.create('tapemeasure', [[1,4],[3,4]], {name: 'd'});
//var tape = brd.create('tapemeasure', [[1,4],[3,4]], {name: 'd'});
</script>
</body>
</html>
8 changes: 5 additions & 3 deletions src/element/conic.js
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@

polarForm = function (t, suspendUpdate) {
var e = M.Dist(F1) * 0.5,
e4 = e * 4,
transformMat = [
[1, 0, 0],
[0, 1, 0],
Expand All @@ -593,13 +594,14 @@
curve.quadraticform =
JXG.Math.matMatMult(JXG.Math.transpose(transformMat),
JXG.Math.matMatMult([
[-b * 4 * e - a * a, a, 2 * e],
[-b * e4 - a * a, a, 2 * e],
[a, -1, 0],
[2 * e, 0, 0]
], transformMat));
}
return JXG.Math.matVecMult(rotationMatrix, [1, t + a, t * t / (e * 4) + b]);
return JXG.Math.matVecMult(rotationMatrix, [e4, e4 * (t + a), t * t + b * e4]);
};

curve.X = function (phi, suspendUpdate) {
return polarForm(phi, suspendUpdate)[1];
};
Expand Down Expand Up @@ -914,4 +916,4 @@
JXG.JSXGraph.registerElement('hyperbola', JXG.createHyperbola);
JXG.JSXGraph.registerElement('parabola', JXG.createParabola);
JXG.JSXGraph.registerElement('conic', JXG.createConic);
}());
}());

0 comments on commit e6c714a

Please sign in to comment.