MHB Finding 2D Polygon Coordinates from a point

AI Thread Summary
To find the coordinates of a polygon with n sides centered at a point (x, y) with a radius r, the equations for each vertex are x + r cos(2πk/n) and y + r sin(2πk/n), where k ranges from 0 to n-1. This ensures all points are equidistant from the center point, lying on a circle of radius r. The first vertex will be positioned to the right of (x, y) when k=0. If a different starting position is desired, a constant can be added to the cosine and sine functions. These equations provide a straightforward method for generating polygon coordinates based on user input.
Krotus
Messages
2
Reaction score
0
Suppose that I have the coordinates of x and y on a plane.

I am writing a piece of software where the user can select a polygon of 3, 4, 5, 6 or 8 sides. All of the polygon points are equidistant from the x, y point. In other words, if you drew a circle where the center was the x, y point, all of the points of the polygon would line on the circle.

That means, obviously, that the distance of each polygon point is equal to the imaginary circle's radius.

Given that information, what are the equations to create each type of polygon's set of points?
 
Mathematics news on Phys.org
Krotus said:
Suppose that I have the coordinates of x and y on a plane.

I am writing a piece of software where the user can select a polygon of 3, 4, 5, 6 or 8 sides. All of the polygon points are equidistant from the x, y point. In other words, if you drew a circle where the center was the x, y point, all of the points of the polygon would line on the circle.

That means, obviously, that the distance of each polygon point is equal to the imaginary circle's radius.

Given that information, what are the equations to create each type of polygon's set of points?

Hi Krotus, welcome to MHB!

Suppose the polygon will have $n$ sides.
And suppose each of the polygon points must have a distance of $r$ to point $(x,y)$.
Then the x- and y-coordinates of point $k$ of the polygon are given by:
$$\begin{cases}x + r \cos(2\pi \cdot k/n) \\ y + r\sin(2\pi \cdot k/n)\end{cases}$$
where $k$ runs from $0$ to $n-1$. Furthermore, the first point ($k=0$) will be to the right of $(x,y)$.

If you want the first point to be in a different location than to the right of $(x,y)$, we can add a fixed constant to the calls of $\cos$ and $\sin$.
 
Thanks! Very simple. I knew I had to be overthinking it.
 
Suppose ,instead of the usual x,y coordinate system with an I basis vector along the x -axis and a corresponding j basis vector along the y-axis we instead have a different pair of basis vectors ,call them e and f along their respective axes. I have seen that this is an important subject in maths My question is what physical applications does such a model apply to? I am asking here because I have devoted quite a lot of time in the past to understanding convectors and the dual...
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Back
Top