Image:Horocycle normals.svg

From Wikipedia, the free encyclopedia

Horocycle_normals.svg (SVG file, nominally 800 × 800 pixels, file size: 6 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
English: Horocycle in Poincaré disk model and some normals
Source

Opera creata dall'uploader (own work by uploader)

Date

2008-05-30

Author

Claudio Rocchini

Permission
(Reusing this image)

CC-BY 3.0


[edit] Source

You need some basic 2d gemetric functions (line line intersection, circle circle inter. etc)

void Horocycle()
{
        const double DIMX = 800;
        const double DIMY = 800;
        const double B    = 32;

        FILE * fp = fopen("c:\\temp\\horocycle.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
        );

        circle2 gc; gc.c = point2(DIMX/2,DIMY/2); gc.r = (DIMX-2*B)/2;

        fprintf(fp,"<circle cx=\"%g\" cy=\"%g\" r=\"%g\" style=\"fill:#ffffE0;stroke:#000000;stroke-width:3;stroke-opacity:1\" />\n"
                ,gc.c.x,gc.c.y
                ,gc.r
        );      

        circle2 hc; hc.r = DIMX/3; hc.c = point2(DIMX/2,B+hc.r);

        fprintf(fp,"<circle cx=\"%g\" cy=\"%g\" r=\"%g\" style=\"fill:none;stroke:#0000A0;stroke-width:3;stroke-opacity:1\" />\n"
                ,hc.c.x,hc.c.y
                ,hc.r
        );

        const int N = 24;
        int i;
        for(i=0;i<N;++i)
        {
                double a = 2*PI*i/N + PI/N;
                point2 p = hc.point(a);

                fprintf(fp,"<circle cx=\"%g\" cy=\"%g\" r=\"%g\" style=\"fill:#000000;stroke:#000000;stroke-width:3;stroke-opacity:1\" />\n"
                        ,p.x,p.y
                        ,4.0
                );

                segment2 s( p, point2(DIMX/2,B) );
                line2 ax; s.axis(ax);
                line2 ba; ba.orig.x = DIMX/2; ba.orig.y = B; ba.dire.x = 1; ba.dire.y = 0;
                point2 pp; line_line_int(ax,ba,pp);
                double ra = dist(pp,p);

                circle2 cc; cc.c = pp; cc.r = ra;
        
                point2 p1,p2; intersection(cc,gc,p1,p2);

                fprintf(fp,"<path d=\"M%g,%g A%g,%g 0 0,1 %g,%g\" style=\"fill:none;stroke:#800000;stroke-width:1.5;stroke-opacity:1\" />\n"
                        ,p1.x,p1.y
                        ,cc.r,cc.r
                        ,p2.x,p2.y
                );
        }

        fprintf(fp,"</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
current11:51, 30 May 2008800×800 (6 KB)Rocchini ({{Information |Description={{en|1=Horocycle in Poincaré disk model and some normals}} |Source=Opera creata dall'uploader (own work by uploader) |Author=Claudio Rocchini |Date=2008-05-30 |Permission=CC-BY 3.0 |other_versions= }} {{Image)
The following pages on the English Wikipedia link to this file (pages on other projects are not listed):