Just posting a small function for anyone having trouble calculating there angles.
function GetAngle(cx#,cy#,x#,y#)
rem --- cx#, cy# = center point
rem --- x#, y# = point around center
a# = y# - cy#
b# = x# - cx#
if b# = 0.0
if a# = 0.0 then inc ang#,90.0 else inc ang#,270.0
endif
endfunction ang#
...and a little demo.
sync on : sync rate 60
repeat
cls
line 310,240,330,240 : line 320,0,320,250
mx = mousex() : my = mousey()
line 320,240,mx,my
ang# = GetAngle(320,240,mx,my)
rem --- draw arc
for a = 0 to int(ang#)
x = 30 * sin(a) + 320
y = 240 - (30 * cos(a))
dot x,y
next a#
text mx,my+8,str$(ang#)
sync
until spacekey()
end
Hope it's useful
"Earth is the cradle of humanity,
but one cannot live in a cradle forever"
Konstantin E. Tsiolkovsky (1911)