<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.formulasearchengine.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=212.89.223.47</id>
	<title>formulasearchengine - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://en.formulasearchengine.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=212.89.223.47"/>
	<link rel="alternate" type="text/html" href="https://en.formulasearchengine.com/wiki/Special:Contributions/212.89.223.47"/>
	<updated>2026-05-28T12:10:48Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0-wmf.28</generator>
	<entry>
		<id>https://en.formulasearchengine.com/index.php?title=KiteGen&amp;diff=23465</id>
		<title>KiteGen</title>
		<link rel="alternate" type="text/html" href="https://en.formulasearchengine.com/index.php?title=KiteGen&amp;diff=23465"/>
		<updated>2013-10-01T13:37:04Z</updated>

		<summary type="html">&lt;p&gt;212.89.223.47: /* Aluminium smelter */ spelling error correction: nerby -&amp;gt; nearby&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Antialiased chessboard using the Lanczos algorithm, made by myself based on the source in File:Antialiased.png&#039;s description. This one should be relatively close to an ideal filter, primarily because I used a lot of taps (several million) for the more problematic pixels.&lt;br /&gt;
== Licensing: ==&lt;br /&gt;
{{PD-self|date=February 2009}}&lt;br /&gt;
&lt;br /&gt;
Here&#039;s the source I used, written by myself. The choice of 16384x16384 might have been overkill; I cannot spot any significant differences between this and using 1024x1024 taps all over the image. The generation took about an hour on one core of an Intel Q9450. Compile and link with &amp;quot;gcc -O3 -o antialias antialias.c -lm -std=gnu99&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;math.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 /*&lt;br /&gt;
  * Do a finer sampling the higher up we get in the picture,&lt;br /&gt;
  * since there&#039;s much more detail there.&lt;br /&gt;
  */&lt;br /&gt;
 #define SAMPLES_FROM_Y(y) ((16384 * 512) / (y*y + 512))&lt;br /&gt;
 #define MAX_SAMPLES SAMPLES_FROM_Y(0)&lt;br /&gt;
&lt;br /&gt;
 float weights[MAX_SAMPLES][MAX_SAMPLES];&lt;br /&gt;
&lt;br /&gt;
 static inline int color(double x, double y)&lt;br /&gt;
 {&lt;br /&gt;
         double t, z;&lt;br /&gt;
         int i, j, k;&lt;br /&gt;
&lt;br /&gt;
         x = x * (1.0 / 128.0) - 0.5;&lt;br /&gt;
         y = y * (1.0 / 2048.0);&lt;br /&gt;
&lt;br /&gt;
         t = 1.0 / (y + 0.001);&lt;br /&gt;
         z = t * x;&lt;br /&gt;
         i = floor(t);&lt;br /&gt;
         j = floor(z);&lt;br /&gt;
         k = i + j;&lt;br /&gt;
         return ((k % 2) != 0);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 static double sinc(double x)&lt;br /&gt;
 {&lt;br /&gt;
         static const double cutoff = 1.220703668e-4;  /* sqrt(sqrt(eps)) */&lt;br /&gt;
&lt;br /&gt;
         if (abs(x) &amp;lt; cutoff) {&lt;br /&gt;
                 /* For small |x|, use Taylor series instead */&lt;br /&gt;
                 const double x2 = x * x;&lt;br /&gt;
                 const double x4 = x2 * x2;&lt;br /&gt;
&lt;br /&gt;
                 return 1.0 - x2 / 6.0 + x4 / 120.0;&lt;br /&gt;
         } else {&lt;br /&gt;
                 return sin(x) / x;&lt;br /&gt;
         }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 static double lanczos_tap(double x)&lt;br /&gt;
 {&lt;br /&gt;
         if (x &amp;lt; -3.0 || x &amp;gt; 3.0)&lt;br /&gt;
                 return 0.0;&lt;br /&gt;
         if (x &amp;lt; 0.0)&lt;br /&gt;
                 return sinc(-x*M_PI) * sinc(-x*M_PI / 3.0);&lt;br /&gt;
         else&lt;br /&gt;
                 return sinc(x*M_PI) * sinc(x*M_PI / 3.0);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 static void precalculate_weights(unsigned num_samples)&lt;br /&gt;
 {&lt;br /&gt;
         double total = 0.0;&lt;br /&gt;
         for (int yi = 0; yi &amp;lt; num_samples; ++yi) {&lt;br /&gt;
                 double sy = 6.0 * ((double)yi / num_samples - 0.5);&lt;br /&gt;
                 double wy = lanczos_tap(sy);&lt;br /&gt;
                 for (int xi = 0; xi &amp;lt; num_samples; ++xi) {&lt;br /&gt;
                         double sx = 6.0 * ((double)xi / num_samples - 0.5);&lt;br /&gt;
                         weights[yi][xi] = wy * lanczos_tap(sx);&lt;br /&gt;
                         total += weights[yi][xi];&lt;br /&gt;
                 }&lt;br /&gt;
         }&lt;br /&gt;
&lt;br /&gt;
         double inv_total = 1.0 / total;&lt;br /&gt;
         for (int yi = 0; yi &amp;lt; num_samples; ++yi) {&lt;br /&gt;
                 for (int xi = 0; xi &amp;lt; num_samples; ++xi) {&lt;br /&gt;
                         weights[yi][xi] *= inv_total;&lt;br /&gt;
                 }&lt;br /&gt;
         }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 static double antialiased_color(double x, double y, unsigned num_samples)&lt;br /&gt;
 {&lt;br /&gt;
         double acc = 0.0;&lt;br /&gt;
         double delta = 6.0 / num_samples;&lt;br /&gt;
         int xi, yi;&lt;br /&gt;
         double sx, sy;&lt;br /&gt;
&lt;br /&gt;
         for (yi = 0, sy = y - 3.0; yi &amp;lt; num_samples; ++yi, sy += delta) {&lt;br /&gt;
                 for (xi = 0, sx = x - 3.0; xi &amp;lt; num_samples; ++xi, sx += delta) {&lt;br /&gt;
                         if (color(sx, sy)) {&lt;br /&gt;
                                 acc += weights[yi][xi];&lt;br /&gt;
                         }&lt;br /&gt;
                 }&lt;br /&gt;
         }&lt;br /&gt;
         return acc;&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Copy to Wikimedia Commons|bot=Fbot|priority=true|date=March 2012}}&lt;/div&gt;</summary>
		<author><name>212.89.223.47</name></author>
	</entry>
</feed>