HP Forums
Fill with color in Geometry App - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: HP Prime (/forum-5.html)
+--- Thread: Fill with color in Geometry App (/thread-1296.html)



Fill with color in Geometry App - Alberto Candel - 05-12-2014 07:39 AM

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.


RE: Fill with color in Geometry App - parisse - 05-12-2014 12:13 PM

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.


RE: Fill with color in Geometry App - Alberto Candel - 05-12-2014 04:11 PM

(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.