File:Atan2-Red-Blue.png

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

Original file(1,024 × 1,024 pixels, file size: 68 KB, MIME type: image/png)

Captions

Captions

Add a one-line explanation of what this file represents

Summary[edit]

Description
English: Visualization of the values of the atan2() function in (-1,-1) … (+1,+1). Blue = negative, Red = positive values, White = 0.
Deutsch: Visualisierung der Werte der atan2()-Funktion im Intervall (-1,-1) … (+1,+1). Blau = Negative Werte, Rot = positive Werte. Weiß = 0.
Date
Source Own work
Author RokerHRO

The following self-written C function created the image (as PPM), wich I converted into PNG and optimized to uplad to Commons:

void atanPlane()
{
        printf("P6\n%d %d 255\n", GridSize, GridSize);

        for(int y=0; y<GridSize; ++y)
        for(int x=0; x<GridSize; ++x)
        {
                const double dy = (GridSize/2)-y;
                const double dx = x - (GridSize/2);
                const double a = atan2(dy,dx)/M_PI;

                unsigned char rgb[4];

                if(a<0)
                {
                        rgb[0] = rgb[1] = 255 + 255*a;
                        rgb[2] = 255 + 127*a;
                }else{
                        rgb[0] = 255;
                        rgb[1] = rgb[2] = 255 - 255*a;
                }

                fwrite(rgb, 3, 1, stdout);
        }
        fflush(stdout);
}

Licensing[edit]

I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

File history

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

Date/TimeThumbnailDimensionsUserComment
current10:21, 18 January 2017Thumbnail for version as of 10:21, 18 January 20171,024 × 1,024 (68 KB)RokerHRO (talk | contribs){{Information |Description ={{en|1=Visualization of the values of the atan2() function in (-1,-1) … (+1,+1). Blue = negative, Red = positive values, White = 0.}} {{de|1=Visualisierung der Werte der atan2()-Funktion im Intervall (-1,-1) … (+1,+1)...

There are no pages that use this file.

Metadata