The Interactive Geometry Software Cinderella

Forum: Cinderella Support (E)

Forums->Cinderella Support (E)->CindyScript - problem with circles

byblos
1 stars
CindyScript - problem with circles


Hello everyone !

I have one question for you. I recently started using Cinderella and I have stuck on one problem. Is there any way to draw and create circle, around a point which is created as intersection of two lines using only CindyScript ?

Greetings !
Veljko Vranić

 
on: Fri 01 of Mar, 2013 [10:33 UTC] reads: 160043

Posted messages

author message
byblos
1 stars
Re: CindyScript - problem with circles
on: Fri 01 of Mar, 2013 [23:11 UTC]
Thanks so much for you answers ! I appreciate that ! I have one more question, again about Cindy Script, is it possible to create a locus, or some how rotate one point on a circle, but to rotate it continuously, or at least almost continuously. Cheers !


author message
Aw: Re: CindyScript - problem with circles
on: Sat 02 of Mar, 2013 [12:35 UTC]
> Thanks so much for you answers ! I appreciate that ! I have one more question, again about Cindy Script, is it possible to create a locus, or some how rotate one point on a circle, but to rotate it continuously, or at least almost continuously. Cheers !

Hi,

maybe you should explain in detail what you are trying to do - there are several solutions for this and it's difficult to give the right advice without further information…

Ulli


author message
cameyo
3 stars
Re: CindyScript - problem with circles
on: Fri 01 of Mar, 2013 [16:59 UTC]
Hi Veljko Vranić,

this can be a solution.
Put the following code on Mouse Click Section of Script Editor.
Then click on canvas (with Move Element tool) to draw the objects.

// first set of points
// THIS WORKS
// intersection at y = 0
A = [12,8];
B = [21,-4];
C = [11,-3];
D = [25,3];

// second set of points
// THIS DON'T WORKS
// intersection at y  0
// the circle is draw reflected on X axes
//A = [3,4];
//B = [10,12];
//C = [10,2];
//D = [1,8];

// circle radius
radius = 2;
// segments
m = join(A,B);
n = join(D,C);
// lines
a = parallel(A,m);
b = parallel(C,n);
// intersection point
inter = meet(a,b);
// circle
k = circle(inter,radius);
// draw(A,B);
// draw(C,D);
// drawcircle(I,8);
// draw points, lines, circles and intersection point
drawall([A,B,C,D,a,b,k,inter]);


But there is a problem:
if you try the seconds set of points (uncomment it and comment first set) the circle is wrong.
It is drawed as reflected on X axes.

Is it my mistake OR is a bug ??

Help us Kortenkamp biggrin


Have a nice day.

p.s. Anyway, you can't interact with objects created from CindyScript.
They are different from standard geometric objects (construction objects).


attachment forumCreate.cdy (1.96 Kb)

author message
Aw: Re: CindyScript - problem with circles
on: Fri 01 of Mar, 2013 [17:08 UTC]
> if you try the seconds set of points (uncomment it and comment first set) the circle is wrong.
> It is drawed as reflected on X axes.
>
> Is it my mistake OR is a bug ??
>
> Help us Kortenkamp biggrin

Here I am cool

It's a bug, indeed, but there is a workaround. Replace the circle command with
k = circle(inter.xy,radius);


I probably can fix that easily in the Cinderella code as well and will do so for the next beta release.

Ulli


author message
Aw: Aw: Re: CindyScript - problem with circles
on: Sat 02 of Mar, 2013 [12:34 UTC]
Ok, the new beta should fix the problem (and I hope I did not introduce new ones).

Ulli




Show posts:
 
Language