Curly braces: Difference between revisions
From JSXGraph Wiki
A WASSERMANN (talk | contribs) No edit summary |
A WASSERMANN (talk | contribs) 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() | 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() | 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(); |