Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

According to the definition of Polygon, If a Poly-line's first and last points are connected then it is called Polygon. See the image below. I have P1, .... P5 Polyline. If I draw a line from P5 to P1 then it will be called polygon or not? I am confused here.

A series of points (P1 to P5) arranged in a line

share|improve this question
5  
That's not actually a line; that's a line segment. A line segment can be a (degenerate) polygon, a line can't. For a bit more weirdness, this line segment is also the convex hull of the five points. It is also an ellipse. –  Martin Sojka Aug 15 '12 at 7:37
1  
Isn't this more suited for Math SE? –  akled Aug 15 '12 at 13:31
    
Imagine that this started off as a pentagon, and was rotated and skewed so that all of the vertices wound up appearing colinear in your view plane. It would still be a pentagon. –  David Lively Aug 15 '12 at 13:35
    
Note, that Math is made up by people. People create theories and definitions, and then they prove theorems inside the theory. You can define polygon as you wish, there is no "absolute truth" about what is and what is not some thing (in Math). –  Ivan Kuckir Jan 29 '13 at 21:38
add comment

3 Answers

up vote 5 down vote accepted

Technically? Yes. It's no different to, say, a polygon with the shape of a D with 5 points viewed edge-on.

A polygon is just a closed shape which has 3 or more vertices and edges. A shape with only two vertices is just a line. Meanwhile a shape with 3 vertices and only 2 edges cannot be a closed shape: most libraries would just join the first and last vertices and make it a closed shape then fill it in; otherwise it's just a series of lines!

As far as your graphics library is concerned, yes it's probably a polygon, but that depends on the library.

share|improve this answer
    
This means the above line is a polygon? –  user960567 Aug 15 '12 at 7:24
2  
That's what I said, yes. It doesn't matter whether it appears to be a straight line - it still has over 3 vertices and edges and they're connected in a closed shape. –  Jonathan Hobbs Aug 15 '12 at 7:25
    
Thanks.............. –  user960567 Aug 15 '12 at 7:27
    
Indeed, a closed shape with an area of 0 is still a closed shape. –  Philipp Nov 16 '12 at 9:04
add comment

more sides there are in a polygon the angle is larger, nearing 180 deg. a Googolgon ( a polygon with 10 to the power 100 sides) has an angle of ~180 degrees.

so.. if you keep drawing a straight line, with infinite number of sides, this line will meet the starting point at infinity, right?

I am not a math guy, was trying to teach my 9yr old about a plygon and started reading. Am I wrong?

share|improve this answer
    
The question is not about an endless line (ray), but about a line of limited length (segment). –  Krom Stern Nov 16 '12 at 6:29
1  
@Indika Are you trying to answer the original question or ask a whole new one? GameDev.SE doesn't work like a forum with individual posts: there is a question and you respond to it with an answer. That said: there's no guarantee those lines will meet. If you want some resources for learning maths, I suggest you look through Khan Academy - it's free (as in Wikipedia, because they can afford it) and it covers the entire American public school curriculum with some exceptional lessons (the guy is incredibly good at explaining stuff). –  Jonathan Hobbs Nov 16 '12 at 12:53
add comment

The line is a polygon in computing, since it is composed of 3 or more points, connected by straight lines. The computer doesn't have to understand whether they are on a single line. It just "connects the dots".

But it can be discussed whether it is a polygon in terms of geometry. According to most definitions of a polygon in geometry, polygons are 2-dimensional shapes. The shape in your post is only one dimensional, so in my opinion it is not a polygon.

share|improve this answer
3  
Please don't pass off your opinion for facts. There are in fact polygons with just two points - they are commonly called "digons". –  Martin Sojka Aug 15 '12 at 12:53
1  
That article says itself that "Some authorities do not consider the digon to be a proper polygon". –  Kylotan Aug 15 '12 at 13:12
1  
Correct. They consider it a degenerate case. :) –  Martin Sojka Aug 15 '12 at 13:47
    
When you define each point with an x and a y coordinate, it is two-dimensional. It is a two-dimensional polygon with an area of 0. –  Philipp Nov 16 '12 at 9:07
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.