Le 17/09/2012 17:56, bkpsusmitaa a écrit :
Each branch must be generated apart. When with.../... Will you please explain the steps, .../... plot(X,Y) X and Y are matrices of the same sizes, each column of X and respectively Y is considered as an individual curve. So if X and Y have N columns, N curves will be plotted by the single plot(X,Y) instruction As a first step, it is easier to generate branches in polar coordinates. So we must generate a matrix A of angles and a matrix R of radii. Radii are chosen to drive the angles. The set of radii is the same for all branches. With a = (0:11)/12*360; // starting angles r = (0:30)' // range of radii R = r*ones(a) // matrix of radii for all branches all columns of R are the same, and there are as many columns as angle steps in a. Then, we must generate angles. Each branch (column) has a specific starting angle (from the center). It is respectively replicated with A = ones(r)*a for all radii (rows). Then we must add to A a angular drift describing the spiral. This the r*ones(a) contribution, leading to A = ones(r)*a + r*ones(a) If you want to twist more branches, you can amplify the angular drift, chosing for instance A = ones(r)*a + 3*r*ones(a) Then, the polar to cartesian transform of coordinates must be applided, because plot() works with cartesian coordinates. This is the part X = R.*cosd(A) // polar to cartesian transform Y = R.*sind(A) // .. And finally we plot the result, and tune the axes to isometric scales: plot(X,Y) ax = gca(); ax.isoview = "on"; With the amplified twist (still proportional to radii, but here x3) , this gives: ![]() Samuel |
_______________________________________________ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users