
-----------------------------------
santabruzer
Wed Dec 10, 2003 11:31 pm

How do you make this line into a circle?
-----------------------------------
Hey!
Just wondering.. how you would go about make a line draw a cicle.. as in like 
for i : 1 .. 360
drawline (300, 225, i, 100, 7)  
delay (10)
end for

would draw a triangle....
PLease help!

-----------------------------------
AsianSensation
Wed Dec 10, 2003 11:32 pm


-----------------------------------
equation of a circle, as in x^2 + y^2 = r^2

sub in values for x and find y, then draw it from a center point.

-----------------------------------
Schaef
Wed Dec 10, 2003 11:34 pm


-----------------------------------
To draw a circle you use

"Drawoval" or "Drawfilloval" then in brackets you put (x coor. of circles center, y coor. of circles center, radius, radius, colour)

-----------------------------------
santabruzer
Wed Dec 10, 2003 11:37 pm


-----------------------------------
the problem is that i knew that, but have no idea how to do it.... i'll try and figure it out.. hopefully..

-----------------------------------
Tony
Wed Dec 10, 2003 11:48 pm


-----------------------------------
well you graph circle using y^2 = r^2 - x^2

for i:-50..50
Draw.Dot(i+100,round(sqrt(2500-i*i))+100,red)
delay(10)
end for

for decreasing i:50..-50
Draw.Dot(i+100,-round(sqrt(2500-i*i))+100,red)
delay(10)
end for


and just use those outer coordinates as your second point for the line


for i:-50..50
Draw.Line(100,100,i+100,round(sqrt(2500-i*i))+100,red)
delay(10)
end for

for decreasing i:50..-50
Draw.Line(100,100,i+100,-round(sqrt(2500-i*i))+100,red)
delay(10)
end for


Though it's not a perfect fill :?

You're better off using Draw.FillArc

for i:1..360
Draw.FillArc(100,100,100,100,i-1,i,black)
delay(10)
end for


-----------------------------------
santabruzer
Wed Dec 10, 2003 11:56 pm


-----------------------------------
Thanx..  :D .. wonder why it ain't a perfect fill... (maybe should've paid attention at math class)

-----------------------------------
Homer_simpson
Thu Dec 11, 2003 12:11 am


-----------------------------------
how bout this one?
View.Set ("offscreenonly")
var y := 0.0
for decreasing r : 6000 .. 50 by 20
    cls
    for x : -80 .. 80
        if (r ** 2) >= (x ** 2) then
            y := sqrt ((r ** 2) - (x ** 2))
            drawdot (x + 320, round (y) + 200 - r, 12)
            drawdot (x + 320, round (-y) + 200 - r, 12)
        end if
    end for
    View.Update
    delay (10)

end for

-----------------------------------
santabruzer
Thu Dec 11, 2003 8:49 am


-----------------------------------
nice effect... but i wanted something a lot simpler.. like a line redrawing over and over to form a fill oval... i guess you can't do that..
