Curly braces: Difference between revisions

From JSXGraph Wiki
No edit summary
No edit summary
Line 7: Line 7:
var height = 0.5; // height of the curly brace
var height = 0.5; // height of the curly brace


// Curly brace
var crl = brd.create('curve', [[0],[0]], {strokeWidth:1, strokeColor:'black'});
var crl = brd.create('curve', [[0],[0]], {strokeWidth:1, strokeColor:'black'});
crl.bezierDegree = 3;
crl.bezierDegree = 3;
Line 17: Line 18:
     d[1] *= height/dl;
     d[1] *= height/dl;


     this.dataX = [ A.X(), A.X()+d[1], mid[0], mid[0]+d[1], mid[0], B.X()+d[1], B.X()];
     this.dataX = [ A.X(), A.X()-d[1], mid[0], mid[0]+d[1], mid[0], B.X()-d[1], B.X()];
     this.dataY = [ A.Y(), A.Y()-d[0], mid[1], mid[1]-d[0], mid[1], B.Y()-d[0], B.Y()];
     this.dataY = [ A.Y(), A.Y()+d[0], mid[1], mid[1]-d[0], mid[1], B.Y()+d[0], B.Y()];
};
};
brd.update();
brd.update();

Revision as of 12:52, 19 February 2013