How to draw a n sided regular polygon in cartesian coordinates?
问题 I have been trying to figure out how to write a simple program to compute the x,y points for creating a regular polygon of n sides. Can someone give me some code examples that don't use preexisting functions that draw polygons? I want to understand the process, which I assume is something like this: pick an angle to start from a radius and a center point somehow calculate the x,y position at that distance from the center(how?) divide 360 by the number of sides, move that distance and draw the