Image:Gosper curve 3.svg

From Wikipedia, the free encyclopedia

Gosper_curve_3.svg (SVG file, nominally 320 × 320 pixels, file size: 24 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.

[edit] Summary

Gosper curve of degree 4. Created by me as a vector replacement for Image:Gosper curve 3.png.

[edit] Source

The SVG file is produced by the following Perl script, which is based on the Logo implementation at de:Gosper-Kurve.

 #!/bin/perl
 # SVG Gosper curve generator by Blotwell
 # Released under GFDL
 
 BEGIN{ print <<HEREDOC
 <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
     "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
     <svg xmlns="http://www.w3.org/2000/svg"
          xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"
                 width="320px" height="320px"
                          viewBox="0 0 6400 6400">
 HEREDOC
 ;}
 my $x=500, $y=2500, $a=90;
 printf "<polyline points=\"%i,%i,",$x,$y;
 $PI=3.1415926535897932384264338;
 sub p {printf "%i,%i,",$x,$y;}
 sub fd {my $n=shift; $x+=$n*cos($a*$PI/180); $y-=$n*sin($a*$PI/180); p();}
 sub tl {$a+=shift;}
 sub rt {$a-=shift;}
 my $ln=100;
 rg(4);
 
 sub gl
 {my $st=-1+shift;
 if ($st<0) {fd($ln);}
 else {tl(60); rg($st); rt(60); gl($st); gl($st); rt(120);
 gl($st); rt(60); rg($st); tl(120); rg($st); tl(60); gl($st);}}
 
 sub rg
 {my $st=-1+shift;
 if ($st<0) {fd($ln);}
 else {rg($st); rt(60); gl($st); rt(120); gl($st); tl(60);
 rg($st); tl(120); rg($st); rg($st); tl(60); gl($st); rt(60);}}
 
 END{print '" stroke="black" stroke-width="30" stroke-linejoin="round" fill-opacity="0" />',"\n</svg>\n";}

[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 | +/-

File history

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

Date/TimeDimensionsUserComment
current19:10, 17 March 2007320×320 (24 KB)Blotwell (Newer version with one more sig. fig. in coördinates.)
06:20, 17 March 2007320×320 (19 KB)Blotwell (Gosper curve of degree 4. Created by me as a vector replacement for Image:Gosper curve 3.png.)
The following pages on the English Wikipedia link to this file (pages on other projects are not listed):