_Title "Ying Yang Color Balls" 'b+ 2020-08-19 balls mod 2021-05-04 ' 2020-08-19 pulled this one out of my files for QB64 trans
'Ying yang color.bas 2015-07-08 I know I updated sdlbas version how about SmallBASIC?
'from Ying Yang v3.sdlbas 2015-06-03 MGA
Const sq
= 500, rc
= sq
/ 4 - 40, xc
= sq
/ 2, yc
= sq
/ 2
nc = 1
d = .1
dir = 1
i = 0
acc = .01 'radians
nc = nc + d * dir
If nc
> 255 Then dir
= dir
* -1: d
= d
* dir
If nc
< 1 Then dir
= dir
* -1: d
= d
* dir
drawBall x1, y1, rc, c
drawBall x1, y1, rc / 3, c
x2
= xc
+ rc
* Sin(i
+ 3.1415) y2
= yc
+ rc
* Cos(i
+ 3.1415) drawBall x2, y2, rc, c
drawBall x2, y2, rc / 3, c
i = i + acc
f = 1 - (rr / r) * .5
fcirc x
, y
, rr
, _RGB32(rred
* f
, grn
* f
, blu
* f
)
'from Steve Gold standard
Radius
= Abs(R
): RadiusError
= -Radius: X
= Radius: Y
= 0 Line (CX
- X
, CY
)-(CX
+ X
, CY
), C
, BF
RadiusError = RadiusError + Y * 2 + 1
Line (CX
- Y
, CY
- X
)-(CX
+ Y
, CY
- X
), C
, BF
Line (CX
- Y
, CY
+ X
)-(CX
+ Y
, CY
+ X
), C
, BF
X = X - 1
RadiusError = RadiusError - X * 2
Y = Y + 1
Line (CX
- X
, CY
- Y
)-(CX
+ X
, CY
- Y
), C
, BF
Line (CX
- X
, CY
+ Y
)-(CX
+ X
, CY
+ Y
), C
, BF