From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: plane equation with a radius
Date: Sun, 11 Jul 2010 06:35:05 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 34
Message-ID: <i1bomp$625$>
References: <hnl3gl$2lm$> <hnluqd$bb4$> <hnni13$rja$> <hnoekl$a3e$> <hsij24$dk9$> <hsiko0$2dg$> <i1bbu0$q4v$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1278830105 6213 (11 Jul 2010 06:35:05 GMT)
NNTP-Posting-Date: Sun, 11 Jul 2010 06:35:05 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:652130

"Junghyun " <> wrote in message <i1bbu0$q4v$>...
> Hi, 
> Can I ask another question?
> If a vector can be obtained from the 2 points, how can I define a circle which lies on a plane perpendicular to the given vector with a circle's center point c and the radius r.
> Thank you.
> Junghyun
- - - - - - - - - -
  You want an equation of a circle with center at c, radius r, and lying in a plane orthogonal to the line between points a and b?

  To do this parametrically as in my first posting May 15, I need a way to choose some starting point on the circle.  For this purpose I'll assume that point c does not lie on the line through a and b.  Then do:

 u = cross(c-a,b-a);
 u = u/norm(u);
 v = cross(b-a,u);
 v = v/norm(v);
 p = c + r*(cos(t)*u + sin(t)*v);

As parameter t varies from 0 to 2*pi, p traces a circle of radius r about the center c.

  If c lies on the line but the line does not go through the origin, use

 u = cross(c,b-a);

in the first line of code with the other lines the same.

  If points a, b, c, and the origin are all colinear, then choose whichever coordinate axis, call it d, is not parallel to b-a and do

 u = cross(d,b-a);

for that first line of code.  However you do it, choose some vector d which is not parallel to b-a so that u = cross(d,b-a) is nonzero for that first line of code.

Roger Stafford