From: "Marie " <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: a circle in 3D
Date: Tue, 19 Jul 2011 03:01:12 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 30
Message-ID: <j02s1o$rrc$>
References: <j022js$mr5$> <j02685$4hm$> <j02cvp$lq9$>
Reply-To: "Marie " <>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1311044472 28524 (19 Jul 2011 03:01:12 GMT)
NNTP-Posting-Date: Tue, 19 Jul 2011 03:01:12 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2953825
Xref: comp.soft-sys.matlab:736679

"Roger Stafford" wrote in message <j02cvp$lq9$>...
> "Roger Stafford" wrote in message <j02685$4hm$>...
> > .......
> >   I will give a method in terms of vector analysis and you can translate that into matlab code.  Suppose u is a unit vector pointing from the center toward the point of tangency and v a unit vector normal to the osculating plane.  Then w = cross(u,v) will be a unit vector orthogonal to u and v.  Let c be the center point.  Then all points P along the circle can be generated by:
> > 
> >   P = c + r*(sin(theta)*u + cos(theta)*w);
> > 
> > for an angle theta which ranges from 0 to 2*pi and r the circle's radius.
> > .......
> - - - - - - - - -
>   There is an easier way of thinking about your problem than the one I gave earlier.  The first derivatives of the parametric equations that determine your space curve after being normalized to a unit vector tangent to the curve at the given point, give you the vector w I referred to.  The vector u is determined from the second derivatives in the process of determining the location of the center of curvature and the radius.  It is unnecessary to deal with the normal, v, to the osculating plane for generating the circle.
> Roger Stafford

Thank you so much for your reply.

Yes, I have the unit normal vector, unit tangent vector, the radius (found by 1/curvature), and the center point. 

So you're saying that "u" is on the normal vector, "v" is the tangent vector, and "w" (being cross(u,v)) is the binormal, and with c= center point and r = radius, I need to graph P = c + r*(sin(theta)*u + cos(theta)*w)?

How would I go about coding that? I just started learning the language a week ago. 
I have so far:

theta = 0:100:2*pi;
P = center+radius*(sin(theta)*N + cos(theta)*B);

^ and I'm stuck on there, because you'd need X, Y, and Z. Do I go "P(1), P(2), P(3)"?

Thanks again.