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.
 
Thread 'Video on imaginary numbers and some queries'
Hi, I was watching the following video. I found some points confusing. Could you please help me to understand the gaps? Thanks, in advance! Question 1: Around 4:22, the video says the following. So for those mathematicians, negative numbers didn't exist. You could subtract, that is find the difference between two positive quantities, but you couldn't have a negative answer or negative coefficients. Mathematicians were so averse to negative numbers that there was no single quadratic...
Thread 'Unit Circle Double Angle Derivations'
Here I made a terrible mistake of assuming this to be an equilateral triangle and set 2sinx=1 => x=pi/6. Although this did derive the double angle formulas it also led into a terrible mess trying to find all the combinations of sides. I must have been tired and just assumed 6x=180 and 2sinx=1. By that time, I was so mindset that I nearly scolded a person for even saying 90-x. I wonder if this is a case of biased observation that seeks to dis credit me like Jesus of Nazareth since in reality...
Thread 'Imaginary Pythagoras'
I posted this in the Lame Math thread, but it's got me thinking. Is there any validity to this? Or is it really just a mathematical trick? Naively, I see that i2 + plus 12 does equal zero2. But does this have a meaning? I know one can treat the imaginary number line as just another axis like the reals, but does that mean this does represent a triangle in the complex plane with a hypotenuse of length zero? Ibix offered a rendering of the diagram using what I assume is matrix* notation...
Back
Top