Image:Devils curve a=0.0-1.0 b=1.svg

From Wikipedia, the free encyclopedia

Devils_curve_a=0.0-1.0_b=1.svg (SVG file, nominally 200 × 200 pixels, file size: 359 KB)

Wikimedia Commons logo This is a file from the Wikimedia Commons. The description on its description page there is shown below.
Commons is a freely licensed media file repository. You can help.
Description

Illustration of en:Devil's curve

Source

self-made with en:Matlab

Date

03:15, 14 July 2007 (UTC)

Author

Oleg Alexandrov

Permission
(Reusing this image)

see below



Public domain I, the copyright holder of this work, hereby release it into the public domain. This applies worldwide.

In case this is not legally possible:
I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law.


Afrikaans | Alemannisch | Aragonés | العربية | Asturianu | Български | Català | Česky | Cymraeg | Dansk | Deutsch | Eʋegbe | Ελληνικά | English | Español | Esperanto | Euskara | Estremeñu | فارسی | Français | Galego | 한국어 | हिन्दी | Hrvatski | Ido | Bahasa Indonesia | Íslenska | Italiano | עברית | Kurdî / كوردی | Latina | Lietuvių | Latviešu | Magyar | Македонски | Bahasa Melayu | Nederlands | ‪Norsk (bokmål)‬ | ‪Norsk (nynorsk)‬ | 日本語 | Polski | Português | Ripoarisch | Română | Русский | Shqip | Slovenčina | Slovenščina | Српски / Srpski | Svenska | ไทย | Tagalog | Türkçe | Українська | Tiếng Việt | Walon | ‪中文(简体)‬ | ‪中文(繁體)‬ | zh-yue-hant | +/-

[edit] Source code (MATLAB)


% An illustration of Devil's curve

function main()

   % linewidth and font size
   lw= 30; 
   fs = 250;

% colors
   red=[0.867 0.06 0.14];
   blue = [0, 129, 205]/256;
   green = [0, 200,  70]/256;
   black = [0, 0, 0];
   white = 0.99*[1, 1, 1];

   % Set up the plotting window
   figure(1); clf; set(gca, 'fontsize', fs, 'linewidth', lw/4);
   hold on; axis equal; grid on;

   N=500;  % number of points (don't make it big, code will be slow)
   Lx = 2; Ly = 2;
   
   [X, Y]=meshgrid(linspace(-Lx, Lx, N), linspace(-Ly, Ly, N));   % X and Y coordinates

   Ncurves = 10;
   A = linspace(0, 1, Ncurves);

   figure(2); clf; hold on; axis equal; axis off;
   Color = jet;
   
   for a = A

          b = 1;
          Z = Y.^2.*(Y.^2 - a.^2) - X.^2.*(X.^2 - b.^2);
          
%  graph the curves using 'contour' in figure (2)
          figure(2); [c, stuff] = contour(X, Y, Z, [0, 0]);
          
%  extract the curves from c and graph them in figure(1) using 'plot'
%  need to do this kind of convoluted work since plot2svg can't save
%  the result of 'contour' but can save the result of 'plot'   
          
          [m, n] = size(c);
          while n > 0
                 
                 l=c(2, 1);
                 x=c(1,2:(l+1));  y=c(2,2:(l+1)); % get x and y of contours
                 figure(1); plot(x, y, 'color', Color(floor(58*a^2)+1, :), 'linewidth', lw/2);
                 
                 c = c(:, (l+2):n);
                 [m, n] = size(c);
                 
          end
          
   end;
   
   figure(1); axis equal; axis ([-Lx, Lx, -Ly, Ly]);

   plot2svg(sprintf('Devils_curve_a=0.0-1.0_b=%0.2g.svg', b));
%   saveas(gcf, sprintf('Devils_curve_a=%0.2g_b=%0.2g.eps', a, b), 'psc2');

   

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeDimensionsUserComment
current03:41, 14 July 2007200×200 (359 KB)Oleg Alexandrov ({{Information |Description=Illustration of en:Devil's curve |Source=self-made with en:Matlab |Date= 03:15, 14 July 2007 (UTC) |Author= Oleg Alexandrov }} {{PD-self}} ==Source code (MATLAB)== <pre> <nowiki> % An illust)
03:39, 14 July 2007200×200 (359 KB)Oleg Alexandrov ({{Information |Description=Illustration of en:Devil's curve |Source=self-made with en:Matlab |Date= 03:15, 14 July 2007 (UTC) |Author= Oleg Alexandrov }} {{PD-self}} ==Source code (MATLAB)== <pre> <nowiki> % An illust)
03:27, 14 July 2007200×200 (359 KB)Oleg Alexandrov ({{Information |Description=Illustration of en:Devil's curve |Source=self-made with en:Matlab |Date= 03:15, 14 July 2007 (UTC) |Author= Oleg Alexandrov }} {{PD-self}} ==Source code (MATLAB)== <pre> <nowiki> % An illust)
The following pages on the English Wikipedia link to this file (pages on other projects are not listed):