Image:Simple set1.png

From Wikipedia, the free encyclopedia

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.

[edit] Summary

Made by myself with matlab.

[edit] Licensing

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

% draw a union of rectangles

function main()

   M=10; imag_root=sqrt(-1); lw=2.5; Ball_rad=0.03;
   
   figure(1); clf; hold on; axis equal; axis off;
   
% plot the outer polygonal curve
   color = [139;10;80]/256;
   
   X=[-2.3677    1.7624    0.1177    4.6499   -3.6469    0.6659    3.4803    6.8794];
   Y=[-3.1177    0.2814   -1.1440    2.6937     -0.4496  3.8268    1.5241    5.1425];

%  a dummy plot to avoid a matlab bug causing some lines to appear too thin
   C=1.05;
   plot(C*min(X), C*min(Y), '*', 'color', 0.99*[1, 1, 1]);
   plot(C*max(X), C*max(Y), '*', 'color', 0.99*[1, 1, 1]);

   % plot the big rectangles, and fill their interiors
   n=length(X)/2;
   for i=1:n
      ax=X(2*i-1); bx=X(2*i);
      ay=Y(2*i-1); by=Y(2*i);

      % plot the rectangle
      plot([ax bx bx ax ax], [ay ay by by ay], 'linewidth', lw, 'color', color);

      % round off the corners (a cosmetic thing)
      round_ball(ax+imag_root*ay, Ball_rad, color');
      round_ball(ax+imag_root*by, Ball_rad, color');
      round_ball(bx+imag_root*ay, Ball_rad, color');
      round_ball(bx+imag_root*by, Ball_rad, color');

      % fill the rectangle
      if 1==1
         fill([ax bx bx ax], [ay ay by by], color'/2, 'FaceAlpha', 0.3, 'linewidth', 0.01, 'EdgeAlpha', 0);
      end
   end

   saveas(gcf, 'simple_set1.eps', 'psc2');

function round_ball(z, r, color)
   x=real(z); y=imag(z);
   Theta = 0:0.1:2*pi;
   X = r*cos(Theta)+x;
   Y = r*sin(Theta)+y;
   Handle = fill(X, Y, color);
   set(Handle, 'EdgeColor', color);

File history

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

Date/TimeDimensionsUserComment
current03:59, 7 February 20071,267×1,014 (6 KB)Oleg Alexandrov (Made by myself with matlab. )
The following pages on the English Wikipedia link to this file (pages on other projects are not listed):