Построить эпициклоиду - VB
Формулировка задачи:
X=(a+b)*Cos(t)-a*Cos((a+b)*t/a); Y=(a+b)*Sin(t)-a*Sin((a+b)*t/a); a=12; b=5; 0 <= t<= 2*PI
Решение задачи: «Построить эпициклоиду»
textual
Листинг программы
Option Explicit Private Sub Form_Load() Dim x As Single, y As Single, a As Single, b As Single, t As Single, col As Long AutoRedraw = True: Scale (-28, -28)-(28, 28): DrawMode = vbXorPen ' ГЋГ±ГЁ ГЁ Г±ГҐГІГЄГ* For t = ScaleLeft To ScaleLeft + ScaleWidth Step 4 If t = 0 Then col = vbYellow Else col = &H101010 Line (t, ScaleTop)-Step(0, ScaleHeight), col: CurrentY = 0: Print t Line (ScaleLeft, t)-Step(ScaleWidth, 0), col: CurrentX = 0: Print t Next ' ÝïèöèêëîèäГ* a = 12: b = 5 For t = 0 To 6.28 Step 0.01 x = (a + b) * Cos(t) - a * Cos((a + b) * t / a) y = (a + b) * Sin(t) - a * Sin((a + b) * t / a) If t = 0 Then PSet (x, y) Else Line -(x, y), vbCyan Next End Sub