How to convert the vertices of a polygon object to a list of points?

jospercomp shared this question 3 years ago
Answered

How to convert the vertices of a polygon object (triangle, quadrilateral, pentagon, hexagon, heptagono, etc.) to a list of points and then a matrix of two rows and n columns of each with each vertex in the list.

a=polygon((1,2),(3,4),(5,1))

la=unknownfunction(a)

la={(1,2),(3,4),(5,1)}

mp=unknownfunction2(la)

mp={{1,3,5},{2,4,1}}

Best Answer
photo

like this.

Comments (2)

photo
3

like this.

photo
1

Thank you. That is exactly what I wanted to do

a=Polygon((1,2),(3,4),(5,1))

la={Vertex(a)}

mp={x(la),y(la)}

I thought it was done with functions but they are functions vertex(), x(), y() and syntax of curly brackets {}.

photo
© 2023 International GeoGebra Institute