I am looking to draw a octagon and I need $(x, y)$ coordinates.
2026-03-26 06:05:36.1774505136
On
Can anyone give me x,y coordinates for an octagon?
10.4k Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
4
There are 4 best solutions below
1
On
So, it the side length is $1$, and each edge is at a $135$ degree angle from each other, then the width of the total octagon is $1+\sqrt{2}$ Does this give you enough information to start calculating the points?
These are most easily done using a rotation matrix: $$R = \left[\begin{array}{cc} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{array}\right]$$ So that if you have a coordinate $\left[\begin{array}{c} x \\ y\end{array}\right]$, the vector $$R\left[\begin{array}{c} x \\ y\end{array}\right] = \left[\begin{array}{c} x\cos\theta - y\sin\theta \\ x\sin\theta +y\cos\theta\end{array}\right]$$ is $\left[\begin{array}{c} x \\ y\end{array}\right]$ rotated $\theta$ radians counterclockwise around the origin.
Now suppose one vertex of your octagon is at $(1,0)$. To get the second vertex, you should rotate this by $\frac{2\pi}{8} = \frac{\pi}{4}$. And to get the third vertex, you rotate the second by $\frac{\pi}{4}$ and so on. This is a general solution that you can utilize to find the coordinates (e.g. using a computer) for any regular $n$-gon.
An regular octagon is special in the sense that you will get the simple expression $$(1,0),(\frac{\sqrt{2}}{2}, \frac{\sqrt{2}}{2}), (0,1), (-\frac{\sqrt{2}}{2}, \frac{\sqrt{2}}{2}), (-1,0), (-\frac{\sqrt{2}}{2}, -\frac{\sqrt{2}}{2}), (0, -1), (\frac{\sqrt{2}}{2}, -\frac{\sqrt{2}}{2})$$ for its coordinates.
Edit: To get the coordinates for a "real" stop sign, you will need to start from the point $(\cos \frac{\pi}{8}, \sin\frac{\pi}{8})$.