Image:Hyperbolic coordinates.svg

From Wikipedia, the free encyclopedia

Hyperbolic_coordinates.svg (SVG file, nominally 800 × 800 pixels, file size: 20 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] Dettagli

Description

Hyperbolic coordinates grip on I cartesian quadrant

Source

self-made

Date

2008-05-13

Author

Rocchini

Permission
(Reusing this image)

CC-BY 3.0


[edit] Source Code

in C++

void hyperbolic_coordinates() {
        const double DIMX = 800; const double DIMY = 800;
        const double B    = 64;  const double S    = 128;
        const double miu  = -2;  const double mau  = 2;
        const double miv  = 0;   const double mav  = 8;
        const int N = 24;        const int M = 1024;

        FILE * fp = fopen("c:\\temp\\hyperbolic_coordinates.svg","w");

        fprintf(fp,
                "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
                "<svg\n"
                "xmlns:svg=\"http://www.w3.org/2000/svg\"\n"
                "xmlns=\"http://www.w3.org/2000/svg\"\n"
                "version=\"1.0\"\n"
                "width=\"%g\"\n"
                "height=\"%g\"\n"
                "id=\"rocco\">\n"
                ,DIMX,DIMY
        );
        fprintf(fp,"<g id=\"edge_layer1\" style=\"fill:none;stroke:#800000;stroke-width:1.5;stroke-opacity:1\">\n" );

        int i,j;
        for(j=0;j<N;++j) {
                const double v = miv + (mav-miv)*double(j)/(N-1);
                fprintf(fp, "<path d=\"" );
                bool first = true;
                for(i=0;i<M;++i) {
                        const double u = miu + (mau-miu)*double(i)/(M-1);
                        double x = v*exp( u); double y = v*exp(-u);
                        x =       x*S+B;      y = DIMY-(y*S+B);
                        if(x>=B && x<=DIMX-B && y>=B && y<=DIMY-B ) {
                                if(first) fprintf(fp,"M ");
                                else      fprintf(fp,"L ");
                                fprintf(fp,"%g %g ",x,y);
                                first = false;
                        }
                }
                fprintf(fp,"\"/>\n");
        }

        fprintf(fp,
                "</g>\n"
                "<g id=\"edge_layer2\" style=\"fill:none;stroke:#000080;stroke-width:1.5;stroke-opacity:1\">\n"
        );

        for(i=0;i<N ;++i) {
                const double u = miu + (mau-miu)*double(i)/(N-1);
                fprintf(fp, "<path d=\"");
                bool first = true;
                for(j=0;j<M;++j)     {
                        const double v = miv + (mav-miv)*double(j)/(M-1);
                        double x = v*exp( u); double y = v*exp(-u);
                        x =       x*S+B;      y = DIMY-(y*S+B);
                        if(x>=B && x<=DIMX-B && y>=B && y<=DIMY-B ) {
                                if(first) fprintf(fp,"M ");
                                else      fprintf(fp,"L ");
                                fprintf(fp,"%g %g ",x,y);
                                first = false;
                        }
                }
                fprintf(fp,"\"/>\n");
        }

        fprintf(fp,
                "</g>\n"
                "</svg>\n"
        );

        fclose(fp);
}

[edit] Licensing

I, the copyright holder of this work, hereby publish it under the following licenses:
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".

Aragonés | العربية | Asturianu | Български | বাংলা | ইমার ঠার/বিষ্ণুপ্রিয়া মণিপুরী | Brezhoneg | Bosanski | Català | Cebuano | Česky | Dansk | Deutsch | Ελληνικά | English | Esperanto | Español | Eesti | Euskara | فارسی | Suomi | Français | Gaeilge | Galego | עברית | Hrvatski | Magyar | Bahasa Indonesia | Ido | Íslenska | Italiano | 日本語 | ქართული | ភាសាខ្មែរ | 한국어 | Kurdî / كوردی | Latina | Lëtzebuergesch | Lietuvių | Bahasa Melayu | Nnapulitano | Nederlands | ‪Norsk (nynorsk)‬ | ‪Norsk (bokmål)‬ | Occitan | Polski | Português | Română | Русский | Slovenčina | Slovenščina | Shqip | Српски / Srpski | Svenska | తెలుగు | ไทย | Türkçe | Українська | اردو | Tiếng Việt | Volapük | Yorùbá | ‪中文(中国大陆)‬ | ‪中文(台灣)‬ | +/-

Creative Commons License
Creative Commons Attribution icon
This file is licensed under the Creative Commons Attribution 3.0 Unported License. In short: you are free to distribute and modify the file as long as you attribute its author(s) or licensor(s). Official license

Català | Česky | Deutsch | English | Ελληνικά | Español | Français | 한국어 | Italiano | עברית | Lietuvių | Magyar | Nederlands | Polski | Português | Русский | Türkçe | ‪中文(繁體)‬ | +/-

You may select the license of your choice.

File history

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

Date/TimeDimensionsUserComment
current08:14, 13 May 2008800×800 (20 KB)Rocchini ({{Information |Description= Hyperbolic coordinates grip on I cartesian quadrant |Source=self-made |Date=2008-05-13 |Author= Rocchini |Permission=CC-BY 3.0 }} )
The following pages on the English Wikipedia link to this file (pages on other projects are not listed):