1

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.

Janmm14
  • 11
  • What does the given angle specify? Where is the center of the circle? What kind of result do you expect/need? – coproc Aug 17 '15 at 06:55
  • The angle is the angle on the circle needing to calculate a point on the circle in 2d. The result should be a 3d point (x,y,z). The center of the circle should be at (0,0,0). – Janmm14 Aug 21 '15 at 14:00

2 Answers2

1

Let $\newcommand{n}{\mathbf n}\newcommand{u}{\mathbf u}\newcommand{v}{\mathbf v}\n$ be the given vector orthogonal to the circle.

You can use two vectors of length $1$ orthogonal to $\n$ and to each other. One way to get these is to choose two other vectors that form a basis together with $\n$ and apply Gram-Schmidt. (Vectors along two axes will be OK as long as $\n$ is not in the plane of those two axes.)

Alternatively, if $\n$ is not along the $z$ axis, project it onto the $x,y$ plane, rotate $90$ degrees, and make a unit length vector in that direction. Then take the cross product with $\n$ and set the result to unit length to get the third vector.

In any case, once you have your two new vectors $\u$ and $\v,$ a point on the circle is given by

$$ (\cos\theta)\u + (\sin\theta)\v.$$

David K
  • 108,155
0

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$$

coproc
  • 1,718