ABにはCircle命令がありますがあまり使い勝手がよくないです。
だから自分でつくるのがいいです。


#N88BASIC

Sub Circle2(cx,cy,r,c)
Dim giantsteps, x,y
giantsteps = 1/r
For y=-1 To 1.01 Step giantsteps
For x=-1 To 1.01 Step giantsteps
If x*x+y*y>1-giantsteps And x*x+y*y<1+giantsteps Then Pset(cx+r*x, cx-r*y),c
Next
Next
End Sub

Sub Circle3(cx,cy,r,c)
Dim t,giantsteps,x,y
giantsteps=(_System_PI+_System_PI)/100.01
For t=0 To 2*3.15 Step giantsteps
x = cx+r*Cos(t)
y = cy-r*Sin(t)
If t=0 Then Pset(x,y),c
Line -(x,y),c
Next
End Sub
Circle (200,200),100,1
Circle2(200,200 ,150,3)
Circle3(200,200 ,200,6)
Print "End"

タグ:

+ タグ編集
  • タグ:

このサイトはreCAPTCHAによって保護されており、Googleの プライバシーポリシー利用規約 が適用されます。

最終更新:2010年03月06日 01:11