A trangle geometric shape

						var board = JXG.JSXGraph.initBoard('box1', {
axis: true, boundingbox: [-15, 15, 15, -15], showcopyright: false,keepaspectratio: true, axis: false, zoom: false,showNavigation: false
  });
var p1 = board.create('point', [-6, 8],{name:'A', size: 1,face:"", color:'blue',fixed: true, label: {offset:[-5,10], color:'blue'}} ); 

var p2 = board.create('point', [-11, -6],{name:'B', size: 1,face:"",fixed: true, color:'blue', label: {offset:[-5,-10], color:'blue'}} );
var p3 = board.create('point', [9, -6],{name:'C', size: 1,face:"", color:'blue', fixed: true,label: {offset:[-5,-10], color:'blue'}} );

var p4 = board.create('point', [-2, -2],{name:'D', size: 1,face:"", color:'blue',fixed: true, label: {offset:[-5,-10], color:'blue'}} );


var l1 = board.create('segment', [p1, p2],{strokeWidth:2});
var l2 = board.create('segment', [p2,p3],{strokeWidth:2});
var l3 = board.create('segment', [p3,p1],{strokeWidth:2});
var l4 = board.create('segment', [p4,p1],{strokeWidth:2,dash:2});
var l5 = board.create('segment', [p4,p2],{strokeWidth:2,dash:2});
var l6 = board.create('segment', [p4,p3],{strokeWidth:2,dash:2,color:"red"});
var mp1 = board.create('midpoint', [p4, p2],{name:'O', size: 1,face:"", color:'blue',fixed: true, label: {offset:[-8,-10], color:'blue'}} );
var l7 = board.create('segment', [p1, mp1],{dash:2});
var l8 = board.create('segment', [p3, mp1],{dash:2});
var mp2 = board.create('midpoint', [p3, p2],{name:'E', size: 1,face:"", color:'blue',fixed: true, label: {offset:[-8,-10], color:'blue'}} );
sl = l6.getSlope()
var sinB = (p3.Y()-p4.Y())/l6.L();
var cosB = (p3.X()-p4.X())/l6.L();

//alert(sinB+"\n"+cosB+"\n"+sl+"\n"+(sinB/cosB))
var px = p2.X()+cosB*l6.L();
var py = p2.Y()+sinB*l6.L();

var p9 = board.create('point', [px, py],{face:"", color:'blue',fixed: true,});
var l10 = board.create('segment', [p9, p2],); 
var l10 = board.create('segment', [p9, p1],); 
var l11 = board.create('segment', [p9, mp1],{dash:2});

					

The image appears in the following posts

Triangle posted 1 year ago

Scroll to Top