File:Polygon spiral.png

From testwiki
Jump to navigation Jump to search
    Original file (400 × 350 pixels, file size: 17 KB, MIME type: image/png)

    This file is from Wikimedia Commons and may be used by other projects. The description on its file description page there is shown below.

    File:Polygon spiral.svg is a vector version of this file. It should be used in place of this PNG file when not inferior.

    File:Polygon spiral.png → File:Polygon spiral.svg

    For more information, see Help:SVG.

    In other languages
    Alemannisch ∙ العربية ∙ беларуская (тарашкевіца) ∙ български ∙ বাংলা ∙ català ∙ нохчийн ∙ čeština ∙ dansk ∙ Deutsch ∙ Ελληνικά ∙ English ∙ British English ∙ Esperanto ∙ español ∙ eesti ∙ euskara ∙ فارسی ∙ suomi ∙ français ∙ Frysk ∙ galego ∙ Alemannisch ∙ עברית ∙ हिन्दी ∙ hrvatski ∙ magyar ∙ հայերեն ∙ Bahasa Indonesia ∙ Ido ∙ italiano ∙ 日本語 ∙ ქართული ∙ 한국어 ∙ lietuvių ∙ македонски ∙ മലയാളം ∙ Bahasa Melayu ∙ မြန်မာဘာသာ ∙ norsk bokmål ∙ Plattdüütsch ∙ Nederlands ∙ norsk nynorsk ∙ norsk ∙ occitan ∙ polski ∙ prūsiskan ∙ português ∙ português do Brasil ∙ română ∙ русский ∙ sicilianu ∙ Scots ∙ slovenčina ∙ slovenščina ∙ српски / srpski ∙ svenska ∙ தமிழ் ∙ ไทย ∙ Türkçe ∙ татарча / tatarça ∙ українська ∙ vèneto ∙ Tiếng Việt ∙ 中文 ∙ 中文(中国大陆) ∙ 中文(简体) ∙ 中文(繁體) ∙ 中文(马来西亚) ∙ 中文(新加坡) ∙ 中文(臺灣) ∙ +/−
    New SVG image

    Transferred from en.wikipedia to Commons by Maksim.

    The original description page was here. All following user names refer to en.wikipedia.

    This graphic of an approximate logarithmic spiral made up from polygonal subunits was created using the perl interface to the ImageMagick image manipulation software:

    #!/usr/bin/perl
    
    use Image::Magick; #the perl interface to the ImageMagic software
    use Math::Trig;
    
    # The points of the polygon. Arbitrary.
    ($x0,$y0) = (0,0);
    ($x1,$y1) = (10,0);
    ($x2,$y2) = (20,5);
    ($x3,$y3) = (5,15);
    
    # length of lower side divided by length of upper side:
    $factor = sqrt((($x2-$x3)**2 + ($y2-$y3)**2) / (($x1-$x0)**2 + ($y1-$y0)**2));
    
    # angle between upper side and lower side, in radians:
    $angle = atan(($y2-$y3)/($x2-$x3)) - atan(($y1-$y0)/($x1-$x0));
    
    # Create an empty white image:
    $image=Image::Magick->new(size=>'400x350');
    $image->Read('xc:white');
    
    $polygon_points = "$x0,$y0 $x1,$y1 $x2,$y2 $x3,$y3 $x0,$y0";
    
    # Create two sample polygons 
    $image->Draw(primitive=>'polygon', points=>$polygon_points, stroke=>red, translate=>"30,30");
    $image->Draw(primitive=>'polygon', points=>$polygon_points, scale=>"$factor,$factor", stroke=>red, translate=>"70,30");
    
    # Now place 5 of them side by side, appropriately stretched and turned
    $stretch = 1; $turn = 0; $posX = 120; $posY = 250;
    for (1..5) {
      $image->Draw(primitive=>'polygon', points=>$polygon_points, scale=>"$stretch,$stretch", stroke=>red, rotate=>$turn * 180/pi, translate=>"$posX,$posY");
      $posX = $posX + $stretch * ( cos($turn) * ($x3-$x0) - sin($turn) * ($y3-$y0));
      $posY = $posY + $stretch * ( sin($turn) * ($x3-$x0) + cos($turn) * ($y3-$y0));
      $turn = $turn + $angle;
      $stretch = $stretch * $factor;
    }
    
    # Add some text
    $image->Set(font=>'-*-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-*'); #this only works on the X window system
    $image->Annotate(text=>"polygonal subunits", x=>30, y=>75, fill=>black);
    $image->Annotate(text=>"approximate logarithmic spiral", x=>120, y=>310, fill=>black);
      
    # Write out the image in the png format
    $image->Write('polygon_spiral.png');
    
    GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.
    w:en:Creative Commons
    attribution share alike
    This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported 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.
    This licensing tag was added to this file as part of the GFDL licensing update.
    date/time username edit summary
    10:02, 10 December 2004 en:User:Solitude (assuming by user, {{GFDL}})
    12:17, 9 August 2002 en:User:Brion VIBBER (<nowiki>...</nowiki>)
    21:30, 8 August 2002 en:User:Josh Grosse (Moving from image credits)

    Original upload log

    Legend: (cur) = this is the current file, (del) = delete this old version, (rev) = revert to this old version.

    Click on date to download the file or see the image uploaded on that date.

    • (del) (cur) 11:49, 20 July 2002 . . . . 400x350 (17711 bytes)

    Captions

    Add a one-line explanation of what this file represents

    Items portrayed in this file

    depicts

    File history

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

    Date/TimeThumbnailDimensionsUserComment
    current19:01, 19 March 2006Thumbnail for version as of 19:01, 19 March 2006400 × 350 (17 KB)wikimediacommons>MaksimLa bildo estas kopiita de wikipedia:en. La originala priskribo estas: This graphic of an approximate logarithmic spiral made up from polygonal subunits was created using the perl interface to the ImageMagick image ma

    There are no pages that use this file.