[Scilab-users] Regarding multiply-armed equiangular (or Logarithmic) spirals
Samuel Gougeon
sgougeon at free.fr
Wed Sep 19 22:50:18 CEST 2012
Le 17/09/2012 17:56, bkpsusmitaa a écrit :
> .../...
> Will you please explain the steps,
> .../...
>
Each branch must be generated apart. When with
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20120919/572514bd/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: moz-screenshot-4.png
Type: image/png
Size: 5914 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20120919/572514bd/attachment.png>
More information about the users
mailing list