Jump to content

File:Thomae function (0,1).svg

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Size of this PNG preview of this SVG file: 800 x 413 pixels. Other resolutions: 320 x 165 pixels | 640 x 330 pixels | 1,024 x 528 pixels | 1,280 x 660 pixels | 2,560 x 1,320 pixels.
Original file (SVG file, nominally 1,280 x 660 pixels, file size: 1.05 MB)
This is a file from the Wikimedia Commons. Information from its description page there is shown below.
Commons is a freely licensed media file repository. You can help.

Summary

DescriptionThomae function (0,1).svg
English: Plot of Thomae's function on the interval (0,1). Shown are all rational points with denominator at most 200. The topmost point in the middle shows f(1/2) = 1/2

Created using the following Java code:

public class Thomae {

static int gcd(int a, int b) {
while(a>0 && b>0) {
if(a>b) a -= a/b*b;
else b -= b/a*a;
}
return a>0 ? a : b;
}

public static void main(String[] args) {
int max = 200;

int width = 1280;
int height = 660;

int border = 20;
int x0 = border;
int x1 = width - border;
double dx = x1-x0;
int y0 = height - border;
double dy = -dx;
int r=5;

System.out.println("");
System.out.println("");
System.out.println("+ width +"\" height=\""+ height +"\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">");

for(int q=1; q<max; q++) for(int p=0; p<q; p++) if(gcd(p, q) == 1) {
System.out.println(" + (x0+dx*p/q) + "\" cy=\""+ (y0+dy*1/q) +"\" r=\""+ r +"\" fill=\"black\" stroke=\"none\" />");
}

System.out.println("");
}

}
Date
Source Own work
Author Smithers888
SVG development
InfoField
The SVG code is valid.
This vector image was created with Java.

Licensing

Public domainPublic domainfalsefalse
I, the copyright holder of this work, release this work into the public domain. This applies worldwide.
In some countries this may not be legally possible; if so:
I grant anyone the right to use this work for any purpose, without any conditions, unless such conditions are required by law.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

9 October 2008

File history

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

Date/TimeThumbnailDimensionsUserComment
current18:09, 9 October 20081,280 x 660 (1.05 MB)Smithers888{{Information |Description={{en|1=Plot of Thomae's function on the interval (0,1). Shown are all rational points with denominator at most 200. Created using the following Java code: public class Thoma

The following 2 pages use this file:

Global file usage

The following other wikis use this file: