If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: Set Sided Polygon in C++

Re: Set Sided Polygon in C++

I do not understand your algorithm. Perhaps there is something I am missing. It seems to me that if one specifies a polygon with the number of sides greater than or equal to 3, there are an infinite number of possible such polygons. Thus one would need to specify the length of each side and some clever algorithm to determine the angles between each side (such algorithms exist - try google). For more details, see:http://www.mathleague.com/help/geome...ns.htm#polygon

After further thought I realized you must by trying to inscribe a regular polygon ( all sides equal ) on a circle. You will need some algorithm to divide the circumference of the circle into N+1 segments, then draw lines from each segment point to the next going around the circle. The math shouldnt be to difficult. I would be interested in seeing how you solve the problem.

Re: Set Sided Polygon in C++

Originally Posted by Mike Pliam

It seems to me that if one specifies a polygon with the number of sides greater than or equal to 3, there are an infinite number of possible such polygons.

A polygon with less than three sides is an interesting concept... Aside from that: The possibilities of any polygon (number of sides >= 3) are infinite unless you specify some parameters. Even if you postulate a regular polygon they're infinite unless you specify a center and a starting point (e.g.).

Originally Posted by abakiz

Basically I'm struggling too create it with an infinite number of sides.

Re: Set Sided Polygon in C++

abakiz, did you manage to fix this issue? Im working on something similar and as I am new to this struggling with:
void PixelPlotterForm:rawRectangle( int X, int Y, int Width, int Height, Color PixelColour )