January 26, 2021, 06:33:51 AM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
Forum
Help
Search
Gallery
Login
Register
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
Graphics
»
[bb] Plot a circle by Shagwana [ 1+ years ago ]
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: [bb] Plot a circle by Shagwana [ 1+ years ago ] (Read 529 times)
BlitzBot
Jr. Member
Posts: 1
[bb] Plot a circle by Shagwana [ 1+ years ago ]
«
on:
June 29, 2017, 12:28:38 AM »
Title :
Plot a circle
Author :
Shagwana
Posted :
1+ years ago
Description :
This is a little function that plots a circle one-eight at a time.
Code :
Code: BlitzBasic
Function
PlotCircle
(
xpos,ypos,radius
)
x=
0
y=radius
h=
1
-radius
Plot
(
xpos+x,ypos+y
)
;Draw the starting pixels
Plot
(
xpos-x,ypos-y
)
Plot
(
xpos+x,ypos-y
)
Plot
(
xpos-x,ypos+y
)
Plot
(
xpos+y,ypos+x
)
Plot
(
xpos-y,ypos-x
)
Plot
(
xpos+y,ypos-x
)
Plot
(
xpos-y,ypos+x
)
While
y>x
;Loop the arc
If
h<
0
h=h+
(
2
*
(
x+
1
)
)
x=x+
1
Else
h=h+
(
2
*
(
x-y
)
)
+
5
x=x+
1
y=y-
1
EndIf
Plot
(
xpos+x,ypos+y
)
;Draw 1/8 at a time
Plot
(
xpos+y,ypos+x
)
Plot
(
xpos-x,ypos-y
)
Plot
(
xpos-y,ypos-x
)
Plot
(
xpos-x,ypos+y
)
Plot
(
xpos-y,ypos+x
)
Plot
(
xpos+x,ypos-y
)
Plot
(
xpos+y,ypos-x
)
Wend
End Function
Comments :
none...
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
Graphics
»
[bb] Plot a circle by Shagwana [ 1+ years ago ]
SimplePortal 2.3.6 © 2008-2014, SimplePortal