Path: news.mathworks.com!not-for-mail From: "Niall Heavey" <REMOVEniallALLheaveyCAPLOCKS@gmail.com> Newsgroups: comp.soft-sys.matlab Subject: Re: Curve Date: Wed, 30 Jun 2010 15:54:04 +0000 (UTC) Organization: The MathWorks, Inc. Lines: 61 Message-ID: <i0fpas$l7a$1@fred.mathworks.com> References: <i0fl3s$aqc$1@fred.mathworks.com> <i0fno8$60j$1@fred.mathworks.com> Reply-To: "Niall Heavey" <REMOVEniallALLheaveyCAPLOCKS@gmail.com> NNTP-Posting-Host: webapp-05-blr.mathworks.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: fred.mathworks.com 1277913244 21738 172.30.248.35 (30 Jun 2010 15:54:04 GMT) X-Complaints-To: news@mathworks.com NNTP-Posting-Date: Wed, 30 Jun 2010 15:54:04 +0000 (UTC) X-Newsreader: MATLAB Central Newsreader 1711497 Xref: news.mathworks.com comp.soft-sys.matlab:649368 "John D'Errico" <woodchips@rochester.rr.com> wrote in message <i0fno8$60j$1@fred.mathworks.com>... > "Niall Heavey" <REMOVEniallALLheaveyCAPLOCKS@gmail.com> wrote in message <i0fl3s$aqc$1@fred.mathworks.com>... > > Hi all, I am looking to plot a straight forward curve. > > I thought it would be simple enough to do but I can't find anything to help me so far. > > > > Basically I want a curve from point 1 to point 3 that goes through point 2. > > > > Sounds simple enough but does anyone know a function available for it? > > > > Thanks in advance. > > There are infinitely many such curves. > > The simplest is a piecewise linear curve, i.e., connect the dots. > Plot can do it for you. > > If you want a better answer than that, you need to tell us, is > this in two dimensions? Or 3 or more? Must the curve be smooth? > Is this a single valued relationship, or does the curve wrap around? > > John Its two dimensions, it would be better if it is smooth. I'd say the easiest way to explain it would be to send the code: radius = 10; plot(0,0,'b*') hold on i = 4; for j = 1:i*2 t = linspace(0,2*pi,(i*2)+1); t = linspace(-(t(2)/2),((2*pi)-(t(2)/2)),(i*2)+1); r = radius; A = r*cos(t); B = r*sin(t); plot(A(j),B(j),'b*') % axis ([-25 25 -25 25]) % axis square % % text(a(j),b(j),strcat(' User ',num2str(j))) end for j = 1:i t = linspace(0,2*pi,i+1); r = radius*2; a = r*cos(t); b = r*sin(t); plot(a(j),b(j),'g*') axis ([-25 25 -25 25]) axis square text(a(j),b(j),strcat(' User ',num2str(j))) end So basically what i'm trying to do is create a link between the center point and user 1, this would be going through both point A(1),B(1) and A(2),B(2), then the link to user 2 form the center would go through A(3),B(3) and A(4),B(4) and so on. Hope that makes more sense! Thanks