Path: news.mathworks.com!newsfeed-00.mathworks.com!ucberkeley!news-hog.berkeley.edu!tethys.csu.net!newshub.sdsu.edu!news.astraweb.com!router2.astraweb.com!207.217.77.102.MISMATCH!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread3.news.pas.earthlink.net.POSTED!5f968bd6!not-for-mail
From: ellieandrogerxyzzy@mindspring.com.invalid (Roger Stafford)
Newsgroups: comp.soft-sys.matlab
Subject: Re: Draw a star.
Message-ID: <ellieandrogerxyzzy-2108060101440001@dialup-4.232.6.199.dial1.losangeles1.level3.net>
References: <ec8smq02a8a@drn.newsguy.com> <ellieandrogerxyzzy-2008061008490001@dialup-4.232.60.187.dial1.losangeles1.level3.net> <ecau8b0197n@drn.newsguy.com> <ellieandrogerxyzzy-2008062041000001@dialup-4.232.6.13.dial1.losangeles1.level3.net> <ecbin502r8a@drn.newsguy.com>
Organization: -
Lines: 37
Date: Mon, 21 Aug 2006 08:01:43 GMT
NNTP-Posting-Host: 4.232.6.199
X-Complaints-To: abuse@earthlink.net
X-Trace: newsread3.news.pas.earthlink.net 1156147303 4.232.6.199 (Mon, 21 Aug 2006 01:01:43 PDT)
NNTP-Posting-Date: Mon, 21 Aug 2006 01:01:43 PDT
Xref: news.mathworks.com comp.soft-sys.matlab:365626


In article <ecbin502r8a@drn.newsguy.com>, Patrick Flaherty
<Patrick_member@newsguy.com> wrote:

> .....
> A further question though if I might.  I understand reasonably the
> code and explanation you give.  It's my impression though that this
> method is considerably different from what the professor indicated in
> his hints - using 2 complex vectors; e^(i*theta),etc; and a third
> complex vector to normalize the axes.
> ......
> pat
-----------------------
  Writing v = r.*exp(i*theta)), x = real(v), y = imag(v) is equivalent to
saying x = r.*cos(theta) and y = r.*sin(t).

  It is possible the professor was hinting at something like the following
to achieve the desired change of radius using two rotating vectors, one at
the end of the other:

theta = (-1/4:1/28:3/4)*2*pi; % The slow rotation
phi = (0:28)*pi; % The rapid rotation
v = (r1+r2)/2*exp(i*theta) + (r1-r2)/2*exp(i*(theta+phi));
x = real(v); y = imag(v);

At each step the angle theta changes by pi/14 or 1/28 of a revolution,
while phi changes by a half a revolution, so theta+phi changes by
1/28+1/2=15/28 of a revolution.  It is a rotation of one vector about the
end of another longer, more slowly rotating vector.  It adds up to the
same effect as using r = (r1+r2)/2 + (r1-r2)/2*(-1).^[0:28] which
alternates between r1 and r2 in radius.

  I don't know what he planned for the third vector to normalize the
axes.  I can't think of anything in matlab that would work to ensure the
units along the two axes are of the same length except a specific
reference to the 'axes' function or its equivalent, such as 'axes equal'.

Roger Stafford