Post Reply 
Fill with color in Geometry App
05-12-2014, 07:39 AM
Post: #1
Fill with color in Geometry App
Hello,

There may be a good reason for the following behavior with the "fill with color" option in the Geometry App, but I cannot figure it out. The following command

GA:=polygon(0,1+i,2*i,-1+i/2,('display')=(3+filled))

plots a quadrilateral with vertices 0, 1+i, 2i and -1+i/2 and filled with yellow. However, if I store the vertices in a list L1 (say) then

GB:=polygon(L1)

displays the same polygon with no color, just the border (as expected) but

GC:=polygon(L1,('display')=(3+filled))

displays nothing. Why is that? Thank you.
Find all posts by this user
Quote this message in a reply
05-12-2014, 12:13 PM
Post: #2
RE: Fill with color in Geometry App
Because L1 is a list, you must convert it to a sequence in order to flatten all the arguments of polygon. Try
GC:=polygon(op(L1),('display')=(3+filled))
Or use a CAS sequence to store your vertices:
l1:=0,1+i,2*i,-1+i/2;
polygon(l1,('display')=(3+filled))
Note that when using CAS variables, the input is kept exact, e.g. perimeter(l1) will return an exact value.
Find all posts by this user
Quote this message in a reply
05-12-2014, 04:11 PM
Post: #3
RE: Fill with color in Geometry App
(05-12-2014 12:13 PM)parisse Wrote:  Because L1 is a list, you must convert it to a sequence in order to flatten all the arguments of polygon. Try
GC:=polygon(op(L1),('display')=(3+filled))
Or use a CAS sequence to store your vertices:
l1:=0,1+i,2*i,-1+i/2;
polygon(l1,('display')=(3+filled))
Note that when using CAS variables, the input is kept exact, e.g. perimeter(l1) will return an exact value.

Thank you. That works. I was using L1 because it was the result of doing operations that combined other lists of points.

By the way (as a suggestion for future revisions of the "on screen" help) "op" is not documented in Help. Also, Help states that "convex hull" takes lists of points as arguments, but it also takes sequences of points. And Help states that "polygon" takes sets of points as arguments, but it seems to me that it takes list or sequences.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)