Difference between revisions of "Trace curve"

From JSXGraph Wiki
Jump to navigationJump to search
 
(15 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
var A = brd.create('point', [-1.5, -1.5]);
 
var A = brd.create('point', [-1.5, -1.5]);
 
var B = brd.create('point', [1.5, -1.5]);
 
var B = brd.create('point', [1.5, -1.5]);
var C0 = brd.create('point', [1.5, 1.5], {visible:false});
+
var C0 = brd.create('point', [1.5, 1.0], {visible:false});
 
var g = brd.create('line', [A,B], {visible:false});
 
var g = brd.create('line', [A,B], {visible:false});
var h = brd.create('parallel', [g, C0], {visible:true});
+
var h = brd.create('parallel', [g, C0], {visible:true, strokeWidth:1});
var C = brd.create('glider', [0, 1.5, h], {name:'C'});
+
var C = brd.create('glider', [-1.5, 1.0, h], {name:'C'});
 
var p = brd.create('polygon', [A, B, C]);
 
var p = brd.create('polygon', [A, B, C]);
  
var M1 = brd.create('midpoint', [A, B]);
+
var s1 = brd.create('perpendicular', [p.borders[0], C], {dash:3, strokeWidth:1});
var M2 = brd.create('midpoint', [A, C]);
+
var s2 = brd.create('perpendicular', [p.borders[1], A], {dash:3, strokeWidth:1});
var s1 = brd.create('midpoint', [C, M1]);
+
var s3 = brd.create('perpendicular', [p.borders[2], B], {dash:3, strokeWidth:1});
var s2 = brd.create('midpoint', [B, M2]);
 
  
var s = brd.create('midpoint', [s1, s2]);
+
var S = brd.create('intersection', [s1, s2, 0], {name:'S', trace:false});
 +
var curve = brd.create('tracecurve', [C, S], {strokeColor:'blue'});
  
 
</jsxgraph>
 
</jsxgraph>
 +
 +
===The underlying JavaScript code===
 +
 +
<source lang="javascript">
 +
var brd = JXG.JSXGraph.initBoard('jxgbox',{axis:false,boundingbox:[-2,2,2,-2],keepaspectratio:true});
 +
var A = brd.create('point', [-1.5, -1.5]);
 +
var B = brd.create('point', [1.5, -1.5]);
 +
var C0 = brd.create('point', [1.5, 1.0], {visible:false});
 +
var g = brd.create('line', [A,B], {visible:false});
 +
var h = brd.create('parallel', [g, C0], {visible:true, strokeWidth:1});
 +
var C = brd.create('glider', [-1.5, 1.0, h], {name:'C'});
 +
var p = brd.create('polygon', [A, B, C]);
 +
 +
var s1 = brd.create('perpendicular', [p.borders[0], C], {dash:3, strokeWidth:1});
 +
var s2 = brd.create('perpendicular', [p.borders[1], A], {dash:3, strokeWidth:1});
 +
var s3 = brd.create('perpendicular', [p.borders[2], B], {dash:3, strokeWidth:1});
 +
 +
var S = brd.create('intersection', [s1, s2, 0], {name:'S', trace:false});
 +
var curve = brd.create('tracecurve', [C, S], {strokeColor:'blue'});
 +
 +
</source>
  
 
[[Category:Examples]]
 
[[Category:Examples]]
 +
[[Category:Geometry]]

Latest revision as of 14:05, 22 June 2012

The underlying JavaScript code

var brd = JXG.JSXGraph.initBoard('jxgbox',{axis:false,boundingbox:[-2,2,2,-2],keepaspectratio:true});
var A = brd.create('point', [-1.5, -1.5]);
var B = brd.create('point', [1.5, -1.5]);
var C0 = brd.create('point', [1.5, 1.0], {visible:false});
var g = brd.create('line', [A,B], {visible:false});
var h = brd.create('parallel', [g, C0], {visible:true, strokeWidth:1});
var C = brd.create('glider', [-1.5, 1.0, h], {name:'C'});
var p = brd.create('polygon', [A, B, C]);

var s1 = brd.create('perpendicular', [p.borders[0], C], {dash:3, strokeWidth:1});
var s2 = brd.create('perpendicular', [p.borders[1], A], {dash:3, strokeWidth:1});
var s3 = brd.create('perpendicular', [p.borders[2], B], {dash:3, strokeWidth:1});

var S = brd.create('intersection', [s1, s2, 0], {name:'S', trace:false});
var curve = brd.create('tracecurve', [C, S], {strokeColor:'blue'});