One more time (on the precision of the glider)

6 views
Skip to first unread message

Cyrille Piatecki

unread,
Jan 6, 2025, 5:44:55 AM (3 days ago) Jan 6
to JSXGraph
Hello? I apologize to write so much conversations, but we are exploring in many directions JsxGraph and some time we arrive to some bloccages. Look at the attached code. It does nearly what we expect. But

1) there is a lack of precision in the movement of the glider which is a big problem for what we are constructing (the orange point is for translation the blue one for rotation which is not enough precise
2) initialy we would have been happy to dedicate it to rotation be we cannot capture the event.
3) the use of the following code for pc0 ( that is the lftcg) is never documented. Yvan found it in an exemple.
  
const centre = board3.create('point', [4, 5],{name:"",fixed:false,visible:true, size:1});
var leftcg = board3.create('transform', [0.3,0], {type:'translate'});

const pc0 = board3.create('point', [centre,[leftcg]],{visible:false});
const cercle = board3.create('circle',[centre,pc0],{name:"",dash :2,strokeWidth:1});
essairotation.html

Alfred Wassermann

unread,
1:53 AM (21 hours ago) 1:53 AM
to JSXGraph
Dear Cyrille,
indeed, it seems that the possibility to create a transformed copy of an element by e.g. `board.create('point', [original, transform]);` seems to need more documentation. I'll try to do that.

Regarding the glider position your example: the method `trueAngle` returns the angle in degrees, but for the transformation you need the angle in radians. Could you please try
var rot = board3.create('transform', [
function () { return JXG.Math.Geometry.rad(pc0, centre, gl0).toFixed(2); }, centre
], { type: 'rotate' });
rot.bindTo(sq);


Best wishes,
Alfred

Reply all
Reply to author
Forward
0 new messages