Moze mi ktoś wyjaśnić jak ten kod rysuje okrąg bo nie mogę normalnie tego objąć umysłem
"
Sub Lcd_circle(byval X As Word , Byval Y As Word , Byval Radius As Integer , Byval Color As Word)
Local X0 As Word , Y0 As Word , Error As Integer
Local Xp As Word , Yp As Word , Xe As Word , Ye As Word
Error = -radius
Xp = Radius
Yp = 0
While Xp >= Yp
X0 = X + Xp : Y0 = Y + Yp
Call Lcd_set_pixel(x0 , Y0 , Color)
X0 = X - Xp : Y0 = Y + Yp
Call Lcd_set_pixel(x0 , Y0 , Color)
X0 = X + Xp : Y0 = Y - Yp
Call Lcd_set_pixel(x0 , Y0 , Color)
X0 = X - Xp : Y0 = Y - Yp
Call Lcd_set_pixel(x0 , Y0 , Color)
X0 = X + Yp : Y0 = Y + Xp
Call Lcd_set_pixel(x0 , Y0 , Color)
X0 = X - Yp : Y0 = Y + Xp
Call Lcd_set_pixel(x0 , Y0 , Color)
X0 = X + Yp : Y0 = Y - Xp
Call Lcd_set_pixel(x0 , Y0 , Color)
X0 = X - Yp : Y0 = Y - Xp
Call Lcd_set_pixel(x0 , Y0 , Color)
Error = Error + Yp
Incr Yp
Error = Error + Yp
If Error >= 0 Then
Decr Xp
Error = Error - Xp
Error = Error - Xp
End If
Wend
End Sub"
#matematyka #programowanie