
-----------------------------------
JSBN
Thu May 08, 2003 11:57 am

circles + archs
-----------------------------------
i am getting pissed off, so i thought i'd ask. I need to get a circle to move in an arch. can someone give me some pionters?
problem is that after a short period of time it starts to move too quickly :/

-----------------------------------
Tony
Thu May 08, 2003 12:04 pm


-----------------------------------
use trig to find your new location.

SOH CAH TOA

or you could use a circle equation... x^2 / Rx + y^2 / rY = 1

Radius remains the same, X is determined by forloop, solve for y and you got your new position...

Though that would work for 0 to 180 degrees... use trig if you wanna move further.

-----------------------------------
Homer_simpson
Thu May 08, 2003 12:45 pm


-----------------------------------
I dunno if this is what yer askin for... =/
View.Set ("offscreenonly")
var y := 0
var a, b, c := 0.0
a := .001
b := 0
c := 50

for x : -320 .. 320
    y := round (a * ((x + b) ** 2) + c)
    drawfilloval (x + 320, y, 10, 10, 9)
    View.Update
    delay (10)
    cls
end for

-----------------------------------
JSBN
Thu May 08, 2003 6:22 pm


-----------------------------------
yes, but i need it to go faster and for 90o (bottom to mid top) 
+10 bits for helping a mod

-----------------------------------
Homer_simpson
Thu May 08, 2003 6:56 pm


-----------------------------------
i guess this is as fast as it can be...
View.Set ("offscreenonly")
var yy, y := 0
var a, b, c := 0.0
a := .00099
b := 0
c := 0

for x : 0 .. 640
    y := round (a * ((x + b) ** 2) + c)
    
    %remove this loop to make it faster
    for xx : 0 .. 640
        yy := round (a * ((xx + b) ** 2) + c)
        drawdot (xx, yy, 12)
    end for
    %remove this loop to make it faster
    
    drawfilloval (x, y, 10, 10, 9)
    View.Update
    cls
end for


-----------------------------------
Homer_simpson
Thu May 08, 2003 6:58 pm


-----------------------------------
oooooooh sorry=(
nvm the last post try this one u can make it go as fast as u want
var yy, y := 0
var a, b, c := 0.0
a := .00099
b := 0
c := 0

for x : 0 .. 640 by 5 % this is the speed
    y := round (a * ((x + b) ** 2) + c)

    %remove this loop to make it faster
    for xx : 0 .. 640
        yy := round (a * ((xx + b) ** 2) + c)
        drawdot (xx, yy, 12)
    end for
    %remove this loop to make it faster

    drawfilloval (x, y, 10, 10, 9)
    View.Update
    cls
end for

-----------------------------------
Asok
Thu May 08, 2003 8:03 pm


-----------------------------------
hehe JSBN, homer just figured out a nice chunk of your ISP for you. Be sure to give him credit in your ISP.

-----------------------------------
JSBN
Fri May 09, 2003 11:17 am


-----------------------------------
yeah, will do, thx alot man
