1

##### Apps for study and entertainment / Archimedes spiral

« Last post by**eleusmario**on

*March 12, 2018, 06:29:15 AM*»

The archimedes spiral is applied in the construction of various mechanisms, such as scroll compressors, fans, centrifugal pumps, and so on. This is a rather simple and interesting example of fractal.

Code: [Select]

`Var T Decimal, A Decimal, R Decimal, Xs Decimal, Ys Decimal`

Var X0 Decimal, Y0 Decimal, X1 Decimal, Y1 Decimal

Window Res = 150, 250

T = 0.7 'starting point of spiral

A = 0.03 'increment size - spiral trail width

Xs = 125; Ys = 75

X0 = 0; Y0 = 0 'start point of line

While 1 = 1

R = A * T

X1 = R * Cos(T) * 50

Y1 = R * Sin(T) * 50

Straight Ys + Y0, Xs + X0, Ys + Y1, Xs + X1, Black

X0 = X1; Y0 = Y1

T = T + A

Wait Events

Loop