<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Le 17/09/2012 17:56, bkpsusmitaa a écrit :
<blockquote cite="mid:1347897407633-4024830.post@n3.nabble.com"
type="cite">
<pre wrap="">.../...
Will you please explain the steps,
.../...
</pre>
</blockquote>
Each branch must be generated apart. When with<br>
<tt>plot(X,Y)<br>
</tt>X and Y are matrices of the same sizes, each column of X and
respectively Y<br>
is considered as an individual curve. So if X and Y have N columns,<br>
N curves will be plotted by the single plot(X,Y) instruction<br>
<tt><br>
</tt>As a first step, it is easier to generate branches in polar
coordinates.<br>
So we must generate a matrix A of angles and a matrix R of radii.<br>
Radii are chosen to drive the angles. The set of radii is the same<br>
for all branches. With<br>
<tt>a = (0:11)/12*360; // starting angles<br>
r = (0:30)' // range of radii<br>
R = r*ones(a) // matrix of radii for all branches<br>
</tt><br>
all columns of <tt>R</tt> are the same, and there are as many columns
as angle steps in <tt>a</tt>.<br>
Then, we must generate angles.<br>
Each branch (column) has a specific starting angle (from the center).
It is respectively <br>
replicated with<br>
<tt>A = ones(r)*a <br>
</tt>for all radii (rows).<br>
Then we must add to A a angular drift describing the spiral. This the<br>
<tt>r*ones(a)<br>
</tt>contribution, leading to<br>
<tt>A = ones(r)*a + </tt><tt>r*ones(a</tt>)<br>
<br>
If you want to twist more branches, you can amplify the angular drift,
chosing for instance<br>
<tt>A = ones(r)*a + </tt><tt>3*r*ones(a</tt>)<br>
<tt><br>
</tt>Then, the polar to cartesian transform of coordinates must be<br>
applided, because plot() works with cartesian coordinates.<br>
This is the part<br>
<tt>X = R.*cosd(A) // polar to cartesian transform<br>
Y = R.*sind(A) // ..<br>
<br>
</tt>And finally we plot the result, and tune the axes to isometric
scales:<br>
<tt>plot(X,Y)<br>
ax = gca();<br>
ax.isoview = "on";<br>
<br>
</tt>With the amplified twist (still proportional to radii, but here
x3) , this gives:<br>
<img src="cid:part1.02020307.01050604@free.fr" alt=""><br>
<br>
Samuel<br>
<br>
</body>
</html>