После публикации в журнале выложу статью, а пока картинки с алгоритмами:. (На черном фоне картинки вроде лучше смотрятся...)
Private Sub Комманда1_Click() pi = 4 * Atn(1) xmax = 600 ymax = 500 scal = 15 a = 0.5 b = 14 c = -1 e = -2 For x = ss To xmax Step ss For y = ss To ymax Step ss xx = (x - 270) / scal yy = -(y - ymax / 2) / scal K = (1 * xx ^ 2 + 1 * yy ^ 2) ^ 2 - 254 * (1 * xx ^ 2 - 1 * yy ^ 2) - 14 K = Abs(K) red = Abs(255 - (0.03 * K)) Mod 255 green = Abs(255 - (0.04 * K)) Mod 255 blue = Abs(255 - (0.05 * K)) Mod 255 Col = RGB(red, green, blue) If ss > 1 Then Line (x + 90, y)-Step(ss, ss), Col, BF If ss = 1 Then PSet (x + 90, y), Col Next y Next x End Sub
Private Sub Комманда1_Click() Cls DrawWidth = 2 pi = 4 * Atn(1) x0 = 350 y0 = 180 aa = 200 b = 200 ss = 3 xx1 = 0: yy1 = 0: k = 10 For a = 20 To aa Step 5 For f = 0 To pi * 2 Step 0.001 If KeyAscii = 32 Then End t = (b / a) ^ 4 - (Sin(2 * f)) ^ 2 If t > 0 Then t1 = Cos(2 * f) + (t) ^ 0.5 If t1 > 0 Then r = a * (t1) ^ 0.5 qrr = Abs(255 * Sin(f * 2)) qgg = Abs(255 * Sin(f * 3)) qbb = Abs(255 * Sin(f * 4)) col = RGB(qrr, qgg, qbb) xx = r * Cos(f) yy = r * Sin(f) If ss > 1 Then Line (xx + 350, yy + 300)-Step(ss, ss), col, BF If ss = 1 Then PSet (xx + 350, yy + 300), col Else zzzz = 0 End If Next f Next a End Sub
Private Sub Комманда1_Click() Cls DrawWidth = 2 pi = 4 * Atn(1) x0 = 350 y0 = 180 a = 150 bb = 280 ss = 2 xx1 = 0: yy1 = 0: k = 10 For b = 150 To bb Step 6 For f = 0 To 2 * pi Step 0.0041 If KeyAscii = 32 Then End t = (b / a) ^ 4 - (Sin(2 * f)) ^ 2 If t > 0 Then t1 = Cos(2 * f) + (t) ^ 0.5 If t1 > 0 Then r = a * (t1) ^ 0.5 qrr = Abs(255 * Sin(f * 2.5)) qgg = Abs(255 * Sin(f * 5)) qbb = Abs(255 * Sin(f * 3)) col = RGB(qrr, qgg, qbb) xx = r * Cos(f) yy = r * Sin(f) If ss > 1 Then Line (xx + 350, yy + 300)-Step(ss, ss), col, BF If ss = 1 Then PSet (xx + 350, yy + 300), col Else zzzz = 0 End If Next f Next b End Sub
Private Sub Комманда1_Click() Cls DrawWidth = 2 pi = 4 * Atn(1) x0 = 350 y0 = 180 a = 200 bb = 280 ss = 2 ReDim x1(num), y1(num), a1(num), L1(num) xx1 = 0: yy1 = 0: k = 10 For b = a To 0 Step -6 For f = 0 To 2 * pi Step 0.0041 If KeyAscii = 32 Then End t = (b / a) ^ 4 - (Sin(2 * f)) ^ 2 If t > 0 Then t1 = Cos(2 * f) + (t) ^ 0.5 If t1 > 0 Then r = a * (t1) ^ 0.5 qrr = Abs(255 * Sin(f * 2.5)) qgg = Abs(255 * Sin(f * 5)) qbb = Abs(255 * Sin(f * 3)) col = RGB(qrr, qgg, qbb) xx = r * Cos(f) yy = r * Sin(f) If ss > 1 Then Line (xx + 350, yy + 300)-Step(ss, ss), col, BF If ss = 1 Then PSet (xx + 350, yy + 300), col Else zzzz = 0 End If Next f Next b End Sub
Private Sub Комманда1_Click() Cls DrawWidth = 2 pi = 4 * Atn(1) x0 = 350 y0 = 180 a = 200 bb = 280 ss = 2 ReDim x1(num), y1(num), a1(num), L1(num) xx1 = 0: yy1 = 0: k = 1: j = 1 For b = a To 20 Step -4 For f = 0 To 2 * pi Step 0.001241 If KeyAscii = 32 Then End k = -k If k = -1 And j = 1 Then j = -j u = 10 If b < a Then u = 0.42 * Atn((b / (a ^ 2 - b ^ 2) ^ 0.5) ^ 2) If (f < u Or f > (2 * pi - u)) Or (f > pi - u And f < pi + u) Then t = ((b / a) ^ 4 - (Sin(2 * f)) ^ 2) If t > 0 Then t1 = (Cos(2 * f) + k * (t) ^ 0.5) If t1 > 0 Then r = a * (t1) ^ 0.5 qrr = Abs(255 * Sin(f * 5 + pi / 2)) qgg = Abs(255 * Sin(f * 5.5)) qbb = Abs(255 * Sin(f * 3)) col = RGB(qrr, qgg, qbb) xx = r * Cos(f) yy = r * Sin(f) If ss > 1 Then Line (xx + 350, yy + 300)-Step(ss, ss), col, BF If ss = 1 Then PSet (xx + 350, yy + 300), col Else zzzz = 0 End If End If Next f Next b End Sub
Private Sub Комманда1_Click() Cls DrawWidth = 2 pi = 4 * Atn(1) x0 = 350 y0 = 180 a = 1 bb = 160 ss = 2 n = 2 xx1 = 0: yy1 = 0: k = 1: j = 1 For a = 0 To 5 Step 0.25 For f = 0 To 8 * pi Step 0.001 If KeyAscii = 32 Then End If k = -1 And j = 1 Then j = -j t = (a - (Sin(n * f)) ^ 2) If t > 0 Then t1 = (Cos(n * f) + j * (t) ^ 0.5) If t1 > 0 Then r = bb * k * (t1) ^ (1 / n) qrr = Abs(255 * Sin(f * 5 + pi / 2)) qgg = Abs(255 * Sin(f * 5.5)) qbb = Abs(255 * Sin(f * 3)) col = RGB(qrr, qgg, qbb) xx = r * Cos(f) yy = r * Sin(f) If ss > 1 Then Line (xx + 350, yy + 300)-Step(ss, ss), col, BF If ss = 1 Then PSet (xx + 350, yy + 300), col Else zzzz = 0 End If k = -k: j = -j Next f Next a End Sub
n=1.5 Код смотрите в предыдущем текстовом окне.
n=2.25 Код смотрите в предыдущем текстовом окне.
Теперь два рисунка из теории яйцевидных поверхностей... подробности в статье...
Private Sub Комманда1_Click() Cls DrawWidth = 2 pi = 4 * Atn(1) x0 = 350 y0 = 180 a = 200 bb = 160 ss = 2 n = 0 ReDim x1(num), y1(num), a1(num), L1(num) xx1 = 0: yy1 = 0: k = 1: j = 1 For b = 1# To 1.007 Step 0.001 For x = -a To a Step 0.1 If KeyAscii = 32 Then End If k = -1 And j = 1 Then j = -j t = (a ^ 2 - x ^ 2) If t > 0 Then y = k * t ^ 0.5 / (1.6 * b ^ x) qrr = Abs(43 * n) qgg = Abs(255 - 50 * n) qbb = Abs(128) col = RGB(qrr, qgg, qbb) xx = x yy = y If ss > 1 Then Line (xx + 350, yy + 300)-Step(ss, ss), col, BF If ss = 1 Then PSet (xx + 350, yy + 300), col Else zzzz = 0 End If k = -k: j = -j Next x n = n + 1 Next b End Sub
Private Sub Комманда1_Click() Cls DrawWidth = 2 pi = 4 * Atn(1) x0 = 350 y0 = 180 a = 200 bb = 160 ss = 6 n = 0 ReDim x1(num), y1(num), a1(num), L1(num) xx1 = 0: yy1 = 0: k = 1: j = 1 For x = -a To a Step 0.01 If KeyAscii = 32 Then End If k = -1 And j = 1 Then j = -j t = (a ^ 2 - x ^ 2) If t > 0 Then y = k * t ^ 0.5 / (1.6 * 1.0014 ^ x) qrr = Abs(43) qgg = Abs(255) qbb = Abs(128) col = RGB(qrr, qgg, qbb) xx = x yy = y If ss > 1 Then Line (xx + 350, yy + 300)-Step(ss, ss), col, BF If ss = 1 Then PSet (xx + 350, yy + 300), col Else zzzz = 0 End If k = -k: j = -j Next x n = n + 1 End Sub
.