## Line Patterns

This page started out a long time ago as a test for the Python code to draw lines into a bitmap structure. This iteration is written in Javascript and uses the HTML canvas to render the patterns.

The patterns on this page are created by defining a number of dots evenly around a circle and then connecting them with straight lines. The different patterns are created by varying the number of points and the algorithm for deciding which points to join. Currently there are three algorithms:

 Star: This has two parameters, the number of points (n) and the step size (m). We start with the first point (0) and advance 'm' points to the next (m) and draw a line, we then move to 2m and draw again. we continue this until we return to the original point. This has one parameter, the number of points (n). We join every point to every other point. This has two parameters, the number of points (n) and the multiplier (m). We start at the second point (1) and repeatedly multiply by 'm' until we return to the starting point. Fills in the missing lines from the "Powers" pattern. Draws a star (as above), but shrinks towards the centre as it goes around. Multiple laps create a spiral effect. Draws multiple copies of a star, each one shrunk and rotated.

Pattern: N: M:

Spiral Factor (%): Laps (%):

Rotate (deg): Shrink (%): Repeat:

Colours Range: Start: End: Back:

## Animation This is an animation of the complete graphs 3-29 generated using using examples 2-29 in the Python code linked below.

## The Line Patterns Python Module

The line pattern module was developed mainly as a test for the line drawing algorithm. The module comes with an example function that draws patterns like these below.

Passing a tuple such as (11,4) to the 'example' method will draw a star. The second image is the (11,4) star, it has eleven points with the edges joining every 4th point.

The third and fourth images are examples 100 and 100 respectively third and fourth images are generated by superimposing sets of stars and show the sets based on (5,2) and (7,1), with varying phases and sizes.    The source for these patterns can be downloaded from the source code page.

## Other pages

(c) John Whitehouse 2010 - 2020