Two identical squares with 30 degrees angle

						var board = JXG.JSXGraph.initBoard('box1', {
boundingbox: [-10, 10, 10, -10],showNavigation:false, showcopyright: false, axis: false,
});

var p1 = board.create('point', [0, 4.0],{name:"D",face:'',label:{offset:[-5,10]}});
var p2 = board.create('point', [0, -3.0],{visible:false});
var p3 = board.create('point', [-7, -3.0],{visible:false});
var p4 = board.create('point', [-7, 4.0],{visible:false});
var pol1 = board.create('polygon', [p1, p2, p3, p4],{visible:false});

var t1 = board.create('transform', [-Math.PI/12,p1], {type: 'rotate'});
var pol2 = board.create('polygon', [pol1, t1], {color: 'blue'});
 pol2.vertices[1].setAttribute({name: "A",face:'',withlabel:true});
 pol2.vertices[2].setAttribute({name: "B",face:'',withlabel:true});
  pol2.vertices[3].setAttribute({name: "C",face:'',withlabel:true});
var t2 = board.create('transform', [(Math.PI/12+Math.PI/2),p1], {type: 'rotate'});
var pol3 = board.create('polygon', [pol1, t2], {color: 'blue'});
 pol3.vertices[1].setAttribute({name: "E",face:'',withlabel:true});
pol3.vertices[2].setAttribute({name: "F",face:'', withlabel:true});
pol3.vertices[3].setAttribute({name: "G",face:'',withlabel:true});
 pol2.vertices[0].setAttribute({face:'',});
 pol3.vertices[0].setAttribute({face:'',});
 var l1 = board.create('segment', [ pol2.vertices[1],  pol3.vertices[3]],{strokewidth:1});
 var a1 = board.create('angle', [p1, pol3.vertices[3],pol2.vertices[1]],{radius:1,name:'75°',label:{offset:[-8,0]}});					

The image appears in the following posts

Square posted 1 year ago

Scroll to Top