I already know how to get a point on a circle (here), but I need a circle in 3d which should be the orthogonal to a given vector.
I got:
- Angle in degree/radians
- Circle radius
- Orthogonal vector
I think, I need to rotate the 2d circle positions to be orthogonal to the given vector, but I do not how how to do that.
Let us denote the angle by $\theta$, the radius by $r$ and the orthogonal vector by $\vec a$ ("axis"); furthermore let us assume the length of $\vec a$ is 1.
First you must define which point is defined by $\theta=0$. If $\vec a$ is not parallel to the $xy$-plane then there is a unique vector $\vec v_0 = (x_0\, 0\, z_0)$ orthogonal to $\vec a$ with length $r$ and $x_0 > 0$. (Otherwise you need a different choice for $\vec v_0$. In 3D there is no obvious way to define such a $\vec v_0$ for any $\vec a$.)
Then all you need to do is rotate the vector $\vec v_0$ around $\vec a$ by the angle $\theta$. The formula is: $$ \cos \theta\ \vec v_0 + (1-\cos \theta)(\vec a \cdot \vec v_0)\vec a + \sin \theta\ \vec a \times \vec v_0$$