arcellipse

21 views
Skip to first unread message

Cyrille Piatecki

unread,
Oct 18, 2021, 3:13:44 AM10/18/21
to JSXGraph
It seems that Jsxgraph laks of a command arcellipse which can plot only a portion of an ellipse. It would be great to add-it. But perhaps I am wrong in that case I would be pleased if some one can show me the way to plot only a part of an ellipse.

Alfred Wassermann

unread,
Oct 18, 2021, 6:50:41 AM10/18/21
to JSXGraph
One way to implement an elliptical arc is to construct an ellipse in the usual way and add two parameters,
controlling where the curve starts and ends.
Without these two parameters, the ellipse curve starts at t=0 and ends at t=2*pi, i.e. is a closed curve.
Here is an example:

var p1 = board.create('point', [-1, 2]);
var p2 = board.create('point', [ 1, 2]);
var p3 = board.create('point', [0, 3]);

var ell = board.create('ellipse', [
  p1, p2, p3, 0, Math.PI], {
  lastArrow: {type: 7}
});

See it live at https://jsfiddle.net/ugqjdvbe/ .

Best wishes,
Alfred

Cyrille Piatecki

unread,
Jan 27, 2022, 12:40:31 PM1/27/22
to JSXGraph
Thanks to answer so kindly. Now I have the following problem. I would have a glider on an ellipse. Apparently no problem. But I want my ellipse to have some part dashed and some not. So I tried
var pe1 = board.create('point',[-11.3,-4], {name:'',size: 1, visible:false});
var pe2 = board.create('point',[-13.7,-4], {name:'',size: 1, visible:false});
var pe3 = board.create('point',[-12.5,-4.4], {name:'',size: 1, visible:false});
var el1 = board.create('ellipse',[pe1,pe2,pe3,0,2*Math.PI]);
var el2 = board.create('ellipse',[pe1,pe2,pe3,Math.PI,2*Math.PI]);
var el = board.create('group',[el1,el2]);
var glc1 = board.create('glider',[-12.45,-2.75,el],{name:'',size: 1});

but this return an error. What can I do ?

I found a solution but it is not elegant. I trace the full ellipse and associate the Glider with it but I set the visible parameter to false and thne I trace my two parts. Is there a better way?
Reply all
Reply to author
Forward
0 new messages