21

Not sure if this is where I should be posting something like this, but here goes.

I wrote a small program today that maps 512 evenly-spaced points on the edge of a circle, and then, iterating over each point, draws a line from the center to that point on the edge.

Also this image is drawn on a canvas that is 500x500 pixels in size.

The result is the image below, and where my question arises

enter image description here

What's curious about this image to me is that there are these little diamonds that are appearing at various points in the circle.

Is there an explanation as to why these shapes are being produced?

lee
  • 823
Delfino
  • 321

2 Answers2

40

That is a Radial Moire pattern. The Wikipedia article on Moire patterns doesn't currently mention the radial version, but it is below for reference: https://en.wikipedia.org/wiki/Moir%C3%A9_pattern

As of this writing, the website: http://thomasshahan.com/Radial/ Provides an example: Radial Moire pattern

That is a snip from a portion of it. Its not as good as yours, I suspect because it is widening the lines the further they are from center. You weren't sure where to post it, I recognize it from general Moire patterns that are encountered in computer science/graphics.

Anti-aliasing should help reduce it: https://en.wikipedia.org/wiki/Anti-aliasing Which usually requires multiple pixels per line width with various shading.

An example of such code is at: https://www.codeproject.com/Articles/13360/Antialiasing-Wu-Algorithm

Simple image from that site: enter image description here

Notice that the Anti-aliased lines appear thickened. Another image from that last site zooms in on some lines: enter image description here

B. Young
  • 520
16

The pattern formed is called Moire pattern which appears when two or more repetitive structures (such as screens, grids or gratings) are superposed or viewed against each other. This is an interference pattern produced between superposed layers with periodically modulated transmittance and close geometrical characteristics (period and orientation). The mathematical representation of such interference is the point-by-point multiplication of the reflectance/transmittance functions of the superposed (overlaped) gratings.

A simple example is obtained by taking two identical ruled transparent sheets of plastic, superposing them, and rotating one about its center as the other is held fixed as shown in the following figure:

1

The visual appearance of the Moire patterns depends on the characteristics of gratings and on the location of the observer. The visual displays can either be static or dynamic. The dynamic displays are CRT TV, LCD, and OLED, whereas static displays are a printed picture or photograph. In visual displays, the Moire effect may create undesirable visual effects.

Moire patterns can also be created by plotting series of curves on a computer screen. Here, the interference is provided by the discretization of the finite-sized pixels. A few more examples are as follows:

2

Richard
  • 2,085
  • 15
  • 27