Thomae function (0,1)


Autor/Urheber:
Größe:
1280 x 660 Pixel (1105606 Bytes)
Beschreibung:
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("<?xml version=\"1.0\" standalone=\"no\"?>");
		System.out.println("<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">");
		System.out.println("<svg width=\""+ 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("  <circle cx=\""+ (x0+dx*p/q) + "\" cy=\""+ (y0+dy*1/q) +"\" r=\""+ r +"\" fill=\"black\" stroke=\"none\" />");
		}
		
		System.out.println("</svg>");
	}
	
}
Lizenz:
Public domain
Bild teilen:
Facebook   Twitter   Pinterest   WhatsApp   Telegram   E-Mail
Weitere Informationen zur Lizenz des Bildes finden Sie hier. Letzte Aktualisierung: Thu, 11 Jul 2024 20:22:28 GMT


Relevante Artikel

Thomaesche Funktion

Die thomaesche Funktion, benannt nach dem deutschen Mathematiker Carl Johannes Thomae (1840–1921), ist eine mathematische Funktion, die auf den rationalen Zahlen unstetig und auf den irrationalen stetig ist. Sie ist verwandt mit der Dirichlet-Funktion und hat wie diese keine praktische Bedeutung, sondern dient als Beispiel für Stetigkeit und weitere mathematische Themen. .. weiterlesen