# Kaleidoscope Paint

Kaleidoscope Paint (also called 5 Minute Kaleidoscope) is a simple app that lets you create an infinite number of kaleidoscopic patterns. Use it as an aid to meditation or for mindless amusement.

The tube-based kaleidoscope was invented in 1816 by Scottish born Sir David Brewster (a scientist and inventor, among other professions). He named his invention kaleidoscope from the Greek words, kalos (beautiful), eidos (form), and scopes (watcher). Simply put, the kaleidoscope is a "beautiful form watcher."

Kaleidoscopes are enchanting devices. This enchantment stems from the symmetric and colorful designs that occur as tubes containing bits of colored glass and mirrors rotate.

This app have been created to reveal this symmetry. This app paints an endless variety of symmetric and colorful designs.

Currently this divides its drawing area into 15 quadrants. Randomly located and colored lines are drawn in the first quadrant. Symmetry occurs by reflecting that quadrant's lines into the other 14 quadrants.

Only one class is necessary for the Kaleidoscope; one that incorporates a constructor and a Paint() method.

The app make extensive use of loops, as new shapes constantly appear on the Kaleidoscope i.e Draw Screen. In this app, the screen is divided into 15 triangles with a common point in the middle of the screen. The final division looks somewhat like the British flag with fifteen triangles. Every object that is drawn in one of the fifteen triangles, is also drawn in perspective in the other fourteen triangles, i.e. flipped, rotated, and/or mirrored.

For each iteration A, a color chosen by user is picked; then two pairs of coordinates are randomly chosen. For each sub-iteration B, the random points are checked, and should they lie outside the triangle, the pairs are chosen again, until they both lie within the triangle. End of iteration B. Now, two "steps" are randomly chosen. These numbers lie between 0 and 4. For each of 40 iterations C, the first of the two previously picked pairs of coordinates are continuously incremented by step1 (both x and y), and the same for the second pair using step2. End of iteration C. After 50 iterations of A, B, and C, the screen is swiped from left to right, and the algorithm starts anew.

## Comments