Path: news.mathworks.com!not-for-mail From: "Marie " <mrvns3@gmail.com> 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$1@newscl01ah.mathworks.com> References: <j022js$mr5$1@newscl01ah.mathworks.com> <j02685$4hm$1@newscl01ah.mathworks.com> <j02cvp$lq9$1@newscl01ah.mathworks.com> Reply-To: "Marie " <mrvns3@gmail.com> NNTP-Posting-Host: www-06-blr.mathworks.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: newscl01ah.mathworks.com 1311044472 28524 172.30.248.38 (19 Jul 2011 03:01:12 GMT) X-Complaints-To: news@mathworks.com NNTP-Posting-Date: Tue, 19 Jul 2011 03:01:12 +0000 (UTC) X-Newsreader: MATLAB Central Newsreader 2953825 Xref: news.mathworks.com comp.soft-sys.matlab:736679 "Roger Stafford" wrote in message <j02cvp$lq9$1@newscl01ah.mathworks.com>... > "Roger Stafford" wrote in message <j02685$4hm$1@newscl01ah.mathworks.com>... > > ....... > > 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); plot3( ^ 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.