Drawing a cirle around a vector

I have a (normal) vector and a position point. I’d like to draw a circle of radius R around the position point, and in the plane described by the normal vector.

I feel it’s a simple problem, but my mind is getting numb. Any ideas?

Draw a circle around the origin in the x-y plane, then translate it to your position point and rotate it to your normal vector. This makes the translation trivial and the rotation a matter of finding the angle and axis of rotation between two vectors (your normal and the initial +z unit vector, the circle’s original normal). Ask again if you need more details about any of these steps.

Alternately consider that the circle in the x-y plane is just a trivial case in general you can draw a circle by generating points of the form
P = Asin(Theta)+Bcos(Theta) where A and B are vectors representing the axis of your circle, the x-y plane is the case where A = <0,1,0} and B = <1,0,0>. Given a normal you can generate two perpendicular vectors and use them as your axis. This is more complex, but more useful for some situations

Originally posted by eldonantonio:
[b]I have a (normal) vector and a position point. I’d like to draw a circle of radius R around the position point, and in the plane described by the normal vector.

I feel it’s a simple problem, but my mind is getting numb. Any ideas?[/b]

Let the position point be O, the normal N. Any point X on the desired circle satisfies the following equations:

{ dot(OX,N)=0, |OX|=R }

From them we obtain a one-parametric set of points X, lying on the plane circle.

Thanks a lot guys, all your suggestions are really good and that should do the trick. I’ll come back and bother you if for some reason it doesn’t work

Hi Zeno,

I need the same solution as well. The translation is trivial to understand, but how to find the angle of axis rotation is not fully understood by me. Can you explain it in a simpler way or in a more detailed way?
Especially I don’t understand the your circle's original normal.

I was kinda tempted to wait 15 years to reply to this :wink:

What I meant was if you draw a circle in the x-y plane, then its axis (call it A) is in the +z direction. That’s probably a better word than normal vector.

Suppose the target direction you want the axis to point is V. Then VxA/|VxA| is the normalized axis of rotation and asin((VxA)/(|V|*|A|) is the angle. You should be able to look up how to create a rotation matrix from an axis+angle pair.

I think chowe6685’s method is better if you’re just generating this circle once and then leaving it alone.

Edit: Fixed my vector math notation.

1 Like

Thank you, now I can understand your solution. :wink: