File:Фрактальные лесопосадки.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(SVG file, nominally 720 × 290 pixels, file size: 8.36 MB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary[edit]

Description
Русский: Векторизация рисунка «Фрактальные лесопосадки», созданного с помощью MetaPost (Это одна из конфигураций, так как скрипт стохастичен.)
Date
Source Фрактальные лесопосадки.png
Author KleverI
SVG development
InfoField
 
The source code of this large SVG is valid.
 
This oversized vector image was created with MetaPost.
Source code
InfoField

metapost-source code

%фрактальная лесопосадка
 beginfig(1) ;
   u:=1mm; branchrotation := 50;
   offset := 180-branchrotation;
   thinning := 0.7;
   shortening := 0.8;
   def drawit(expr p, linethickness,col) =
     draw p withpen pencircle scaled linethickness withcolor col;
   enddef;
   %A- основание B- направление роста, n - число бранчей,
   %size толщина дерева, col цвет
   vardef tree(expr A,B,n,size,col) =
     save C,D,thickness; pair C,D;
     thickness := size;
     C := shortening[B, A rotatedaround(B,
       offset+uniformdeviate(branchrotation))];
     D := shortening[B, A rotatedaround(B,
       -offset-uniformdeviate(branchrotation))];
     if n>0:
       drawit(A--B, thickness, col);
       thickness := thinning*thickness;
       tree(B, C, n-1, thickness,col);
       tree(B, D, n-1, thickness,col);
     else:
       drawit(A--B,thickness,col);
       thickness := thinning*thickness;
       drawit(B--C, thickness,col);
       drawit(B--D, thickness,col);
     fi;
   enddef;
   numeric nbr,nx,ny,ell,size;
   color col;
   nx:=10;ny:=5;
   pair A;
   for ix:=1 upto nx:
     for iy:=1 upto ny:
       nbr:=4+uniformdeviate 5;
       ell:=nbr*u;
       x:=ix*(1+1/20*normaldeviate);
       y:=iy*(1+1/20*normaldeviate);
       A:=(20u*(x+y*sqrt(2)/2),20u*y*sqrt(2)/2);
       size:=ell/5;
       col:=(uniformdeviate 1,uniformdeviate 1,uniformdeviate 1);
       show ix,iy,A,ell,nbr,size,col;
       tree(A, A+(0,ell), nbr, size,col);
     endfor;
   endfor;
 endfig;

Licensing[edit]

w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 2.5 Generic license.
You are free:
  • to share – to copy, distribute and transmit the work
  • to remix – to adapt the work
Under the following conditions:
  • attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
  • share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

File history

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

Date/TimeThumbnailDimensionsUserComment
current14:56, 13 August 2009Thumbnail for version as of 14:56, 13 August 2009720 × 290 (8.36 MB)KleverI (talk | contribs){{Information |Description={{ru|1=Векторизация рисунка «Фрактальные лесопосадки», созданного с помощью MetaPost (Это о�

The following page uses this file:

File usage on other wikis