How can I compute points along a circle that lays on a plane given the following:
- center $P$ = $(a, b, c)$
- radius $r$
- plane equation $2x - 8y + 5z = 18$
I need to find points along this circle from $[0,2\pi]$ in $\frac{\pi}{4}$ increments. In 2D I would do this like:
$$x = a + r * \cos{\theta}$$ $$y = b + r * \cos{\theta}$$
But I am not sure how I would do this in 3D to include Z.
I've found this and this but I'm not fully understanding how they are getting their perpendicular vectors; I know that the normal vector to the plane $n$ is $\langle 2, -8, 5 \rangle$.
Basically you need to find two unit vectors $u$ and $v$ orthogonal to each other in the rotation plane. Once you have those you can compute the circle points $p$ as:
$p(r, c, \theta) = c + r u \cos \theta + r v \sin \theta$
Where $c$ is the center point, $r$ the radius and $\theta$ the angle.
Now, you can obtain $u$ and $v$ from the plane equation:
$n \cdot x = d$
Where $n$ is the plane normal and $d$ the distance to the origin.
We can pick a random vector $x$ not parallel with $n$
$u = x \times n / \|x \times n\|$
$v = u \times n$
You can check that $n \cdot (c+u) = d$ and $n \cdot (c+v) = d$