How to Plot a Polygon on X-Y Graph Knowing the Radius

In summary, the conversation discusses the desire to plot a regular polygon with a known number of sides and radius on an X-Y graph, and the need for a method to calculate the coordinates of the corners without using a compass or ruler. A potential solution is provided in the form of a formula and confirmed to be correct. An alternative method for constructing a regular polygon is also given.
  • #1
quddusaliquddus
354
3

Homework Statement



I want to plot a Regular Polygon of many sides on a X-Y graph where I know the number of sides and the radius.

I would like a method to calculate the position of the corners of this shape without using compass/ruler.

If there was an algorithm that goes all the way around the shape then that'd be better.

Homework Equations



x^2 + y^2 = r^2

http://en.wikipedia.org/wiki/Polygon"

The Attempt at a Solution



Im afraid I am completely stuck on this. I keep going from calculating all the angles and length of sides of each triangle segment of the polygon to a x-y graph where I am trying to calculate the x-y coordinates of the corners.
 
Last edited by a moderator:
Physics news on Phys.org
  • #3
Hi. At the link I provided there is a formula:

(x,y) = 2R(cos(t), sin(t) )*sin ( t + arcsin ( a / 2R ) )

I just wanted to get ot confrmed that it is correct. It doesn't look it.
 
  • #4
That formula will give a "smooth" curve, not a "broken line" as you need for a polygon.

If you want to construct a regular polygon with n sides, radius r, center at [itex](x_0,y_0)[/itex], the line from the center to one vertex making angle [itex]\theta[/itex] with the x-axis, the coordinates of the vertices are given by

[tex]x= x_0+ r cos(\left(\frac{2\pi}{n}\right)i+ \theta)[/tex]

[tex]y= y_0+ r sin(\left(\frac{2\pi}{n}\right)i+ \theta)[/tex]

Where i runs from 0 to n-1.
 
  • #5
Thanks. Thats exactly what I needed.
 

FAQ: How to Plot a Polygon on X-Y Graph Knowing the Radius

What is the formula for calculating the coordinates of a polygon on an X-Y graph?

The formula for calculating the coordinates of a polygon on an X-Y graph is (x, y) = (r * cos (2πk/n), r * sin (2πk/n)), where r is the radius, k is the number of sides, and n is the total number of sides in the polygon.

How many sides does a polygon have to have in order to plot it on an X-Y graph?

A polygon can have any number of sides, but in order to plot it on an X-Y graph, it must have at least 3 sides. This is because a polygon with less than 3 sides would not be considered a closed shape.

How do you determine the radius of a polygon to plot it on an X-Y graph?

The radius of a polygon is the distance from the center of the polygon to any of its vertices. To determine the radius, you can use the formula r = s/(2sin(π/n)), where s is the length of one side and n is the total number of sides in the polygon.

Can a polygon be plotted on an X-Y graph if the radius is negative?

Yes, a polygon can still be plotted on an X-Y graph if the radius is negative. This simply means that the center of the polygon is located on the opposite side of the X-Y axis as the vertices.

Is it possible to plot a polygon on an X-Y graph without knowing the radius?

No, in order to plot a polygon on an X-Y graph, you must know the radius. This is because the radius is used in the formula to calculate the coordinates of each vertex. Without knowing the radius, the coordinates cannot be determined.

Similar threads

Back
Top