Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Playing with code: a circle function using triangle math
#4
Check this out 1/2 the drawing and it holds water ie a paint!

Code: (Select All)
Screen _NewImage(400, 400, 32)
r = 100
cx = _Width / 2: cy = _Height / 2
y = r
Color &HFFFFFFFF ' use Alpha to see if we overlap at any point points of overlap will be brighter, for some reason have to use 100% opaque for Paint border
While x < y - 1

    y = Sqr(r * r - x * x)

    PSet (cx - x, cy - y)
    PSet (cx + x, cy - y)
    PSet (cx - x, cy + y)
    PSet (cx + x, cy + y)


    PSet (cx - y, cy - x)
    PSet (cx + y, cy - x)
    PSet (cx - y, cy + x)
    PSet (cx + y, cy + x)
    x = x + 1
    Sleep  'you gotta see this draw
Wend
' does it hold water?
Paint (200, 200), &HFF8888FF, &HFFFFFFFF ' yes!
b = b + ...
Reply


Messages In This Thread
RE: Playing with code: a circle function using triangle math - by bplus - 09-14-2023, 01:20 AM



Users browsing this thread: 1 Guest(s)