The Interactive Geometry Software Cinderella

Forum: Cinderella Support (E)

Forums->Cinderella Support (E)->Creating Points in CindyScript

MikeW
1 stars
Creating Points in CindyScript


Hi,
A quick question as I get myself geared up for working in this very interesting and powerful software environment...
I can create a point in CindyScript by type in, for example, A=[2,3] followed by
draw(A)
I am curious why I cannot change the appearance of A using commands like
A.size=15
or
A.color=[0.5,1,0.2]
This type of modification of geometric objects seems to be reserved to those created when the points are created directly in the Cinderella page by the user clicking in point mode to create point A.
So there seems to be a difference in a geometric point labelled A which is defined through CindyScript, and one created in the Cinderella page.
Am I overlooking something... just a bit confused here!
Cheers
Mike

 
on: Tue 20 of Dec, 2011 [23:45 UTC] reads: 143702

Posted messages

author message
MikeW
1 stars
Re: Creating Points in CindyScript
on: Wed 21 of Dec, 2011 [22:41 UTC]
Hi, thanks for the answer. It was very helpful.
I am now working through the documentation section "Special Operators" called "Interaction with Geometry"
In the subsections "Algorithm of an Element" and "Creating a Geometric Element" some internal names of geometric algorithms are given, such as "FreePoint", "Join", "CircleMP", etc.
Is there a comprehensive list of all such algorithm names available in Cindy Script? I could not find it in the documentation, but maybe I have missed it.
Is it possible for the user create new user-defined algorithms with names that can be called in such geometric element creations?
Thanks in advance!
Mike


author message
Aw: Re: Creating Points in CindyScript
on: Fri 23 of Dec, 2011 [13:46 UTC]
> Is there a comprehensive list of all such algorithm names available in Cindy Script? I could not find it in the documentation, but maybe I have missed it.

No, we do not have a comprehensive list; you can always find possible algorithms by using the algorithm-function on a geometric element.

> Is it possible for the user create new user-defined algorithms with names that can be called in such geometric element creations?

No, as these algorithms have to fulfill very specific properties to avoid complications with the internal theorem checking.

All the best,
Ulli



author message
Aw: Creating Points in CindyScript
on: Wed 21 of Dec, 2011 [07:47 UTC]
Hi Mike,

yes, indeed points created by Cinderella and points drawn in CindyScript are different things. If you want to draw a point in a different color or size, try the modifiers to the draw command, for example:

A=[[2,3];
draw(A,size->15,color->[[0.5,1,0.2])


You can also create "real" points using the createpoint()-function, as explained in the manual at Accessing geometric elements.

The main difference between these two kinds of points are that the "draw"-command points are not active, that is, you cannot manipulate them with the mouse, unless you write code for that. In your example above it looks like there is indeed a point called "A", which is caused by the fact that you introduce a variable for the coordinates. But what would you call the points in the following piece of code that draws a 10 by 10 array of points?

repeat(10,x,
  repeat(10,y,
    draw([[x,y])
  )
)


Hope that helps,
Ulli





Show posts:
 
Language