1
Good night
The exercise asks me to implement three structs: Point (coordinates X and Y), polygonal lines (sequence of 2 to 100 points that are the vertices along the line) and polygon (sequence of 3 to 100 points which are the vertices along the polygon and the last coincides with the first).
I implemented the struct for the dots as follows:
typedef struct //Estrutura definida para os pontos.
{
double x;
double y;
} Ponto;
For the polygonal lines I defined as follows, but I do not know if it is correct and if it is the best way.
typedef struct //Estrutura definida para as linhas poligonais.
{
Ponto Vertice;
} Linha;
As for polygons, I had no idea how to do it. But I know that the difference between a polygonal line and a polygon is that, for the polygon, the last and first coordinates are the same (can I specify this already inside the struct?). I would like to have an idea of how to proceed.
Thanks Jefferson! I forgot that I need to define the amount of points of the line within the structure itself. In the case of polygons, when you say manipulate, you mean manipulate within the program itself, right?
– Renan
This, manipulating in the sense of using functions / accessing their values
– Jefferson Quesado