know the equation of a circle in space (3D), how to get the coordinates of n-equal points on the circle

65 Views Asked by At

Know the equation of a circle in space as: $(x - x_{0})^{2} + (y - y_{0})^{2} + (z - z_{0})^{2} = r^{2},\quad a(x - x_{0}) + b(y - y_{0}) + c(z - z_{0}) = 0$. That is known the center $p = (x_{0}, y_{0}, z_{0})$, the radius $r$ and the normal vector $n = (a, b, c)$. The circle is equally divided by n points on the circle, how to get the coordinates of each point? A similar 2-D question has been solve: Formula to calculate the coordinates of some points on a circle How can we solve it for the 3-D case?

1

There are 1 best solutions below

6
On

Step 1: Find the direction $u$ towards one point $q_0$ on the circle. To do this, look at $a,b,c$, and determine which is the smallest in absolute value. If it's $a$, then we're going to make a vector that looks like $(0, s, t)$; if it's $b$, we're going to make a vector that looks like $(s, 0, t)$; if it's $c$, we're going to make a vector that looks like $(s, t, 0)$. Let's take a concrete example: $(a, b, c) = (3, -2, 4)$. Then $|b|$ is the smallest, so we'll look for a vector of the form $(s, 0, t)$.

To find this vector, we take $(a, b, c)$ and make the chosen entry $0$ (in our example, we now have $(3, 0, 4)$), then swap the other two entries, negating the first. In our example, this gets us $(-4, 0, 3)$. Call this vector $w$.

Now compute $u = r \cdot \frac{1}{\|w\|} w$.

Then (this takes a little proof), (1) the point $p + u$ is on the plane defined by $\{X \mid n \cdot (X - p) = 0 \}$, and (2) the point $p + u$ is distance $r$ from $p$, so it's also on the circle.

Step 2: Let $v = \frac{1}{\|n\|} n \times u$. $v$ again lies in the plane, just like $u$, and is perpendicular to $u$, and has the same length as $u$ (namely $r$).

Step 3: Define, for $k = 0, 1, 2, 3, \ldots, n-1$, $$ q_k = p + \cos (\frac{2\pi k}{n}) u + \sin (\frac{2\pi k}{n}) v. $$ Then the points $q_0, q_1, \ldots, q_{n-1}$ are equally spaced around your circle.